# @pnpm/dependency-path

> Utilities for working with symlinked node_modules

Latest version **1001.1.10** (published 2026-02-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pnpm/dependency-path
pnpm add @pnpm/dependency-path
yarn add @pnpm/dependency-path
bun add @pnpm/dependency-path
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1001.1.10 |
| Published | 2026-02-17 |
| First published | 2022-12-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=18.12 |
| Dependencies | 3 |
| Unpacked size | 18.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 36467 |
| Maintainers | pnpmuser, zkochan |
| Keywords | pnpm, pnpm10, node_modules, path |

## Links

- npm: https://www.npmjs.com/package/@pnpm/dependency-path
- Repository: https://github.com/pnpm/pnpm.git#main
- Homepage: https://github.com/pnpm/pnpm/tree/main/packages/dependency-path#readme
- Issues: https://github.com/pnpm/pnpm/issues
- Funding: https://opencollective.com/pnpm
- npm.io page: https://npm.io/package/@pnpm/dependency-path

## Dependencies (3)

- [semver](https://npm.io/package/semver.md) ^7.7.1
- [@pnpm/types](https://npm.io/package/@pnpm/types.md) 1001.3.0
- [@pnpm/crypto.hash](https://npm.io/package/@pnpm/crypto.hash.md) 1000.2.2

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1001.1.10 (latest) — 2026-02-17
- 1001.1.11 (latest-10) — 2026-06-10
- 1001.1.9 — 2026-01-19
- 1001.1.8 — 2025-12-15
- 1001.1.7 — 2025-12-08
- 1001.1.6 — 2025-11-27
- 1001.1.5 — 2025-11-20
- 1001.1.4 — 2025-11-09
- 1001.1.3 — 2025-10-21
- 1001.1.2 — 2025-09-29
- 1001.1.1 — 2025-09-12
- 1001.1.0 — 2025-07-31
- 1001.0.2 — 2025-07-23
- 1001.0.1 — 2025-07-09
- 1001.0.0 — 2025-06-23
- … 39 more at https://npm.io/package/@pnpm/dependency-path/versions

## README

# @pnpm/dependency-path

> Utilities for working with symlinked node_modules

<!--@shields('npm')-->
[![npm version](https://img.shields.io/npm/v/dependency-path.svg)](https://www.npmjs.com/package/dependency-path)
<!--/@-->

Like `path` but for packages in a symlinked `node_modules`. Symlinked `node_modules` is a unique dependencies layout that
[pnpm](https://github.com/pnpm/pnpm) creates.

## Installation

```sh
pnpm add @pnpm/dependency-path
```

## Usage

<!--/* cspell:disable */-->
<!--@example('./example.js')-->
```js
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' }
```
<!--/@-->
<!--/* cspell:enable */-->

## License

MIT

---
_Source: https://npm.io/package/@pnpm/dependency-path · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
