@pnpm/dependency-path
Utilities for working with symlinked node_modules
Last updated a month ago by pnpmuser .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install @pnpm/dependency-path 
SYNC missed versions from official npm registry.

@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

Current Tags

  • 1000.0.0                                ...           latest (a month ago)

30 Versions

  • 1000.0.0                                ...           a month ago
  • 900.0.0                                ...           a month ago
  • 6.0.0                                ...           a month ago
  • 5.1.7                                ...           2 months ago
  • 5.1.6                                ...           4 months ago
  • 5.1.5                                ...           4 months ago
  • 5.1.4                                ...           5 months ago
  • 5.1.3                                ...           5 months ago
  • 5.1.2                                ...           6 months ago
  • 5.1.1                                ...           6 months ago
  • 5.1.0                                ...           7 months ago
  • 5.0.0                                ...           7 months ago
  • 4.0.0                                ...           8 months ago
  • 3.0.0                                ...           9 months ago
  • 2.1.8                                ...           10 months ago
  • 2.1.7                                ...           a year ago
  • 2.1.6                                ...           a year ago
  • 2.1.5                                ...           a year ago
  • 2.1.4                                ...           a year ago
  • 2.1.3                                ...           a year ago
  • 2.1.2                                ...           2 years ago
  • 2.1.1                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 1.1.3                                ...           2 years ago
  • 1.1.2                                ...           2 years ago
  • 1.1.1                                ...           2 years ago
  • 1.1.0                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (2)
Downloads
Total 15
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE