1000.0.9 • Published 7 months ago

@pnpm/dependency-path v1000.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

@pnpm/dependency-path

Utilities for working with symlinked node_modules

npm version

Like path but for packages in a symlinked node_modules. Symlinked node_modules is a unique dependencies layout that pnpm creates.

Installation

pnpm add @pnpm/dependency-path

Usage

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' }

License

MIT

6.0.0

1 year ago

900.0.0

1 year ago

1000.0.5

9 months ago

1000.0.6

9 months ago

1000.0.7

8 months ago

1000.0.8

8 months ago

1000.0.9

7 months ago

1000.0.0

1 year ago

1000.0.1

11 months ago

1000.0.2

11 months ago

1000.0.3

10 months ago

1000.0.4

9 months ago

5.1.7

1 year ago

5.1.6

1 year ago

5.1.5

1 year ago

5.1.4

1 year ago

5.1.3

1 year ago

5.1.2

1 year ago

5.1.1

1 year ago

5.1.0

2 years ago

5.0.0

2 years ago

4.0.0

2 years ago

3.0.0

2 years ago

2.1.8

2 years ago

2.1.7

2 years ago

2.1.6

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.5

2 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago