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 = ;const catNames = ;catNames;//=> 'Snuggles'
Throws if the module can't be found.
null instead of throwing if the module can't be found.
What you would use in
- resolve-global - Resolve the path of a globally installed module
- import-from - Import a module from a given path
- resolve-from - Resolve the path of 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
MIT © Sindre Sorhus