
Company News
Meet the Socket Team at RSAC and BSidesSF 2026
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.
@pnpm/dependency-path
Advanced tools
Utilities for working with symlinked node_modules
Like path but for packages in a symlinked node_modules. Symlinked node_modules is a unique dependencies layout that
pnpm creates.
pnpm add @pnpm/dependency-path
const dependencyPath = require('@pnpm/dependency-path')
const registry = 'https://registry.npmjs.org/'
console.log(dependencyPath.isAbsolute('/foo/1.0.0'))
//> false
// it is confusing currently because relative starts with /.
// It will be changed in the future to vice versa
console.log(dependencyPath.resolve(registry, '/foo/1.0.0'))
//> registry.npmjs.org/foo/1.0.0
console.log(dependencyPath.relative(registry, 'registry.npmjs.org/foo/1.0.0'))
//> /foo/1.0.0
console.log(dependencyPath.refToAbsolute('1.0.1', 'foo', registry))
//> registry.npmjs.org/foo/1.0.1
console.log(dependencyPath.refToAbsolute('github.com/foo/bar/twe0jger043t0ew', 'foo', registry))
//> github.com/foo/bar/twe0jger043t0ew
console.log(dependencyPath.refToRelative('1.0.1', 'foo', registry))
//> /foo/1.0.1
console.log(dependencyPath.parse('/foo/2.0.0'))
//> { isAbsolute: false, name: 'foo', version: '2.0.0' }
MIT
The 'resolve' package is used to resolve module paths in Node.js. It provides similar functionality in terms of resolving paths but is more focused on module resolution rather than dependency path manipulation.
The 'dependency-tree' package generates a dependency tree for a given module. While it provides insights into dependencies, it is more focused on visualizing and analyzing dependency trees rather than manipulating dependency paths.
The 'read-pkg-up' package reads the closest package.json file. It is useful for retrieving package information but does not offer the same level of path manipulation capabilities as @pnpm/dependency-path.
FAQs
Utilities for working with symlinked node_modules
The npm package @pnpm/dependency-path receives a total of 957,535 weekly downloads. As such, @pnpm/dependency-path popularity was classified as popular.
We found that @pnpm/dependency-path demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

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.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.

Research
/Security News
Malicious Packagist packages disguised as Laravel utilities install an encrypted PHP RAT via Composer dependencies, enabling remote access and C2 callbacks.

Research
/Security News
OpenVSX releases of Aqua Trivy 1.8.12 and 1.8.13 contained injected natural-language prompts that abuse local AI coding agents for system inspection and potential data exfiltration.