close
New:Microsoft Teams Notifications Are Now Available in Socket.Learn more →
Get Started

@socketsecurity/lib

Package Overview
Dependencies
Maintainers
2
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@socketsecurity/lib

Core utilities and infrastructure for Socket.dev security tools

latest
Source
npmnpm
Version
7.0.1
Version published
Weekly downloads
8.2K
-40.87%
Maintainers
2
Weekly downloads
 
Created
Source

@socketsecurity/lib

Socket Badge Coverage

Follow @SocketSecurity Follow @socket.dev on Bluesky

Core utilities for Socket.dev tools: file system, processes, HTTP, env detection, logging, spinners, and more. Tree-shakeable, TypeScript-first, cross-platform.

@socketsecurity/lib is the shared utility layer for every Socket.dev tool: the CLI, SDK, registry, MCP server, and build infrastructure. It exists so we ship one battle-tested implementation of "spawn a child", "fetch JSON with retries", "delete a path safely on Windows + POSIX", etc. - rather than ten subtly different ones across the fleet. Every export is reachable via a subpath import, so tree-shaking keeps your bundle lean.

Install

pnpm add @socketsecurity/lib

Usage

import { Spinner } from '@socketsecurity/lib/spinner/spinner'
import { readJson } from '@socketsecurity/lib/fs/read-json'

const spinner = Spinner({ text: 'Loading…' })
spinner.start()
const pkg = await readJson('./package.json')
spinner.successAndStop(`Loaded ${pkg.name}@${pkg.version}`)

Every export lives under a subpath - pick what you need:

import { spawn } from '@socketsecurity/lib/process/spawn/child'
import { httpJson } from '@socketsecurity/lib/http-request'
import { safeDelete } from '@socketsecurity/lib/fs/safe'

Start with the API reference - every subpath export with a one-line description.

Development

Contributor commands
pnpm build            # build
pnpm dev              # watch mode
pnpm install          # install before build
pnpm run cover        # tests with coverage
pnpm run fix          # auto-fix formatting
pnpm run lint         # check style
pnpm test             # run tests

See CLAUDE.md for contributor guidelines.

Documentation map

License

MIT


Socket

Keywords

Socket.dev

FAQs

Package last updated on 27 Aug 2026

Related posts