@socketsecurity/registry


Programmatic access to Socket Registry metadata, constants, and helper
utilities for package management operations.
Installation
pnpm install @socketsecurity/registry
Features
- Manifest API — Query package override metadata by ecosystem and name
- 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
Quick Start
import { getManifestData, Categories, PURL_Type } from '@socketsecurity/registry'
const manifest = getManifestData()
const npmPackages = getManifestData(PURL_Type.NPM)
const packageData = getManifestData(PURL_Type.NPM, 'deep-equal')
if (packageData) {
console.log(packageData.categories)
console.log(packageData.version)
console.log(packageData.engines.node)
}
API Reference
getManifestData()
Query the Socket Registry manifest for package overrides.
function getManifestData(): Manifest
function getManifestData(ecosystem: EcosystemString): ManifestEntry[]
function getManifestData(
ecosystem: EcosystemString,
packageName: string,
): ManifestEntryData | undefined
Enums
enum Categories {
CLEANUP = 'cleanup',
LEVELUP = 'levelup',
SPEEDUP = 'speedup',
TUNEUP = 'tuneup',
}
enum Interop {
BROWSERIFY = 'browserify',
CJS = 'cjs',
ESM = 'esm',
}
enum PURL_Type {
NPM = 'npm',
PYPI = 'pypi',
}
Constants
Import Node.js and package manager constants:
import {
NODE_MODULES,
PACKAGE_JSON,
PNPM_LOCK_YAML,
NPM_REGISTRY_URL,
} from '@socketsecurity/registry'
For a complete list of available constants, see the
package.json exports.
Type Definitions
All types are exported for TypeScript projects:
import type {
Manifest,
ManifestEntry,
ManifestEntryData,
CategoryString,
InteropString,
EcosystemString,
} from '@socketsecurity/registry'
Utilities
Access utility modules for common operations:
import { } from '@socketsecurity/registry/lib/fs'
import { } from '@socketsecurity/registry/lib/packages'
import { } from '@socketsecurity/registry/lib/paths'
See the exports map for all available utility modules.
License
MIT