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,
    });

    Keywords

    none

    Install

    npm i get-dev-paths

    DownloadsWeekly Downloads

    4,248

    Version

    0.2.0

    License

    MIT

    Unpacked Size

    5.6 kB

    Total Files

    4

    Last publish

    Collaborators

    • aleclarson