get-dev-paths

0.2.0 • Public • Published

get-dev-paths

Search node_modules for symlinks that resolve to a package outside any node_modules directories.

Returns an array of symlink paths that match the following criteria:

  • they live in node_modules
  • their real paths are not in node_modules
  • they are non-dev dependencies (as defined in package.json)

Every matched package also has its node_modules searched.

Scoped packages are supported.

New in v0.1.1: Up to 50x faster!

import getDevPaths from 'get-dev-paths';

// When called with one argument, an array is returned which contains symlink
// paths that match the required criteria.
let paths = getDevPaths(process.cwd());

// When you want an array of resolved symlinks, set `preserveLinks` to false:
paths = getDevPaths(__dirname, {
  preserveLinks: false,
});

// When the returned array is missing an expected package, you can use the
// `onError` option to inspect why a symlink was skipped.
paths = getDevPaths(__dirname, {
  onError: console.error,
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    439
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    439
  • 0.1.1
    2,916
  • 0.1.0
    2

Package Sidebar

Install

npm i get-dev-paths

Weekly Downloads

3,357

Version

0.2.0

License

MIT

Unpacked Size

5.6 kB

Total Files

4

Last publish

Collaborators

  • aleclarson