Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aleclarson/get-dev-paths
Search node_modules for locally developed packages
https://github.com/aleclarson/get-dev-paths
fs node-modules nodejs
Last synced: 19 days ago
JSON representation
Search node_modules for locally developed packages
- Host: GitHub
- URL: https://github.com/aleclarson/get-dev-paths
- Owner: aleclarson
- License: mit
- Created: 2018-09-15T18:05:37.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-03-07T15:21:54.000Z (over 3 years ago)
- Last Synced: 2024-10-12T10:05:00.007Z (25 days ago)
- Topics: fs, node-modules, nodejs
- Language: CoffeeScript
- Homepage:
- Size: 14.6 KB
- Stars: 7
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 exist in `package.json` (but not `devDependencies`)Every matched package also has its `node_modules` searched.
Scoped packages are supported.
**New in v0.1.1:** Up to 50x faster!
```js
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,
});
```