peach a19a732be8 commit message | vor 2 Jahren | |
---|---|---|
.. | ||
index.d.ts | vor 2 Jahren | |
index.js | vor 2 Jahren | |
license | vor 2 Jahren | |
package.json | vor 2 Jahren | |
readme.md | vor 2 Jahren |
Resolve the path of a globally installed module
$ npm install resolve-global
$ npm install --global cat-names
const resolveGlobal = require('resolve-global');
console.log(resolveGlobal('cat-names'));
//=> '/usr/local/lib/node_modules/cat-names'
Throws if the module can't be found.
Returns undefined
instead of throwing if the module can't be found.
Type: string
What you would use in require()
.
MIT © Sindre Sorhus