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.
29 lines
727 B
29 lines
727 B
2 years ago
|
declare const resolveGlobal: {
|
||
|
/**
|
||
|
Resolve the path of a globally installed module.
|
||
|
|
||
|
@param moduleId - What you would use in `require()`.
|
||
|
@returns The resolved path. Throws if the module can't be found.
|
||
|
|
||
|
@example
|
||
|
```
|
||
|
// $ npm install --global cat-names
|
||
|
import resolveGlobal = require('resolve-global');
|
||
|
|
||
|
console.log(resolveGlobal('cat-names'));
|
||
|
//=> '/usr/local/lib/node_modules/cat-names'
|
||
|
```
|
||
|
*/
|
||
|
(moduleId: string): string;
|
||
|
|
||
|
/**
|
||
|
Resolve the path of a globally installed module.
|
||
|
|
||
|
@param moduleId - What you would use in `require()`.
|
||
|
@returns The resolved path. Returns `undefined` instead of throwing if the module can't be found.
|
||
|
*/
|
||
|
silent(moduleId: string): string | undefined;
|
||
|
};
|
||
|
|
||
|
export = resolveGlobal;
|