1 | export interface Options {
|
2 | /**
|
3 | Use a custom environment variables object.
|
4 |
|
5 | Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env).
|
6 | */
|
7 | readonly env?: Record<string, string | undefined>;
|
8 |
|
9 | /**
|
10 | Get the PATH key for a specific platform.
|
11 |
|
12 | Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform).
|
13 | */
|
14 | readonly platform?: NodeJS.Platform;
|
15 | }
|
16 |
|
17 | /**
|
18 | Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform.
|
19 |
|
20 | @example
|
21 | ```
|
22 | import pathKey from 'path-key';
|
23 |
|
24 | const key = pathKey();
|
25 | //=> 'PATH'
|
26 |
|
27 | const PATH = process.env[key];
|
28 | //=> '/usr/local/bin:/usr/bin:/bin'
|
29 | ```
|
30 | */
|
31 | export default function pathKey(options?: Options): string;
|