-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
35 lines (26 loc) · 1.06 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/**
Resolve the path of a globally installed module.
@param moduleName - What you would use in [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).
@returns The resolved path. Throws if the module cannot be found.
@example
```
// $ npm install --global cat-names
import {resolveGlobal} from 'resolve-global';
console.log(resolveGlobal('cat-names'));
//=> '/usr/local/lib/node_modules/cat-names'
```
*/
export function resolveGlobal(moduleName: string): string;
/**
Resolve the path of a globally installed module.
@param moduleName - What you would use in [`import()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import).
@returns The resolved path. Returns `undefined` instead of throwing if the module cannot be found.
@example
```
// $ npm install --global cat-names
import {resolveGlobalSilent} from 'resolve-global';
console.log(resolveGlobalSilent('cat-names'));
//=> '/usr/local/lib/node_modules/cat-names'
```
*/
export function resolveGlobalSilent(moduleName: string): string | undefined;