package
Resolve the path of a globally installed module
npm install resolve-globalGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 3 packages.
27.7 kB
Includes dependencies.
Resolve the path of a globally installed module
npm install resolve-globalnpm install --global cat-namesimport {resolveGlobal} from 'resolve-global';
console.log(resolveGlobal('cat-names'));
//=> '/usr/local/lib/node_modules/cat-names'Throws if the module cannot be found.
Returns undefined instead of throwing if the module cannot be found.
Type: string
What you would use in import().