🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@socketsecurity/lib

Package Overview
Dependencies
Maintainers
2
Versions
16
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
1.3.4
Version published
Maintainers
2
Created
Source

@socketsecurity/lib

Socket Badge CI - SocketDev/socket-lib

Follow @SocketSecurity Follow @socket.dev on Bluesky

Core utilities, constants, and helper functions for Socket.dev security tools.

Installation

pnpm install @socketsecurity/lib

Features

  • Constants — Access Node.js, npm, and package manager constants
  • Type Definitions — Full TypeScript support with comprehensive type exports
  • Helper Utilities — File system, path, package, and process utilities
  • Environment Variables — Typed access to environment variables
  • Effects — Visual effects for CLI applications

Usage

Constants

Import Node.js and package manager constants:

import {
  NODE_MODULES,
  PACKAGE_JSON,
  PNPM_LOCK_YAML,
  NPM_REGISTRY_URL,
} from '@socketsecurity/lib/constants/packages'

Environment Variables

Access typed environment variables:

import { getEnv } from '@socketsecurity/lib/env/getters'
import { NODE_ENV } from '@socketsecurity/lib/env/node-env'

const env = getEnv('NODE_ENV')
console.log(NODE_ENV) // 'production' | 'development' | 'test'

For a complete list of available modules, see the package.json exports.

Type Definitions

All types are exported for TypeScript projects:

import type {
  PackageJson,
  TsConfig,
  LockFile,
} from '@socketsecurity/lib/types'

Utilities

Access utility modules for common operations:

// File system utilities
import { readJsonFile, writeJsonFile } from '@socketsecurity/lib/fs'

// Package utilities
import { parsePackageSpec } from '@socketsecurity/lib/packages'

// Path utilities
import { normalizePath } from '@socketsecurity/lib/paths'

// And many more...

See the exports map for all available utility modules.

License

MIT

Keywords

Socket.dev

FAQs

Package last updated on 26 Oct 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts