https://github.com/zkochan/deep-resolve-cwd
Resolve the path of a module through a sequence of packages from the current working directory
https://github.com/zkochan/deep-resolve-cwd
Last synced: 3 months ago
JSON representation
Resolve the path of a module through a sequence of packages from the current working directory
- Host: GitHub
- URL: https://github.com/zkochan/deep-resolve-cwd
- Owner: zkochan
- License: mit
- Created: 2017-05-08T19:14:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-08T19:51:12.000Z (about 8 years ago)
- Last Synced: 2025-03-06T22:17:20.123Z (4 months ago)
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# deep-resolve-cwd
> Resolve the path of a module through a sequence of packages from the current working directory
[](https://www.npmjs.com/package/deep-resolve-cwd) [](https://travis-ci.org/zkochan/deep-resolve-cwd)
## Installation
```sh
npm i -S deep-resolve-cwd
```## Usage
```js
const deepResolveCwd = require('deep-resolve-cwd')console.log(deepResolveCwd(['mos', 'chalk', './package.json']))
//> /home/zkochan/src/deep-resolve-from/node_modules/.registry.npmjs.org/chalk/1.1.3/node_modules/chalk/package.json
```## API
### `deepResolveCwd(moduleIds)`
Like `require()`, throws when the module can't be found.
### `deepResolveCwd.silent(moduleIds)`
Returns `null` instead of throwing when the module can't be found.
#### moduleIds
Type: `string[]`
An array of module IDs, a module ID is something that you pass to `require()`.
## Related
- [deep-resolve-from](https://github.com/zkochan/deep-resolve-from) - Resolve the path of a module through a sequence of packages
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module like `require.resolve()` but from the current working directory## License
[MIT](./LICENSE) © [Zoltan Kochan](https://www.kochan.io)