Bakhtina Sofya b84cb877be 1st comm | há 3 semanas atrás | |
---|---|---|
.. | ||
index.js | há 3 semanas atrás | |
license | há 3 semanas atrás | |
package.json | há 3 semanas atrás | |
readme.md | há 3 semanas atrás |
Import a globally installed module
Please don't use this unless absolutely necessary. Local dependencies should be preferred.
$ npm install import-global
$ npm install --global cat-names
const importGlobal = require('import-global');
const catNames = importGlobal('cat-names');
catNames.random();
//=> 'Snuggles'
Throws if the module can't be found.
Returns null
instead of throwing if the module can't be found.
Type: string
What you would use in require()
.
MIT © Sindre Sorhus