You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
2 years ago | |
---|---|---|
.. | ||
index.d.ts | 2 years ago | |
index.js | 2 years ago | |
license | 2 years ago | |
package.json | 2 years ago | |
readme.md | 2 years ago |
readme.md
resolve-global 
Resolve the path of a globally installed module
Install
$ npm install resolve-global
Usage
$ npm install --global cat-names
const resolveGlobal = require('resolve-global');
console.log(resolveGlobal('cat-names'));
//=> '/usr/local/lib/node_modules/cat-names'
API
resolveGlobal(moduleId)
Throws if the module can't be found.
resolveGlobal.silent(moduleId)
Returns undefined
instead of throwing if the module can't be found.
moduleId
Type: string
What you would use in require()
.
Related
- import-global - Import a globally installed module
- resolve-from - Resolve the path of a module from a given path
- import-from - Import a module from a given path
- is-installed-globally - Check if your package was installed globally
- global-dirs - Get the directory of globally installed packages and binaries
License
MIT © Sindre Sorhus