1 /// <reference types="node" />
3 declare namespace pathKey {
6 Use a custom environment variables object. Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env).
8 readonly env?: {[key: string]: string | undefined};
11 Get the PATH key for a specific platform. Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform).
13 readonly platform?: NodeJS.Platform;
17 declare const pathKey: {
19 Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform.
23 import pathKey = require('path-key');
25 const key = pathKey();
28 const PATH = process.env[key];
29 //=> '/usr/local/bin:/usr/bin:/bin'
32 (options?: pathKey.Options): string;
34 // TODO: Remove this for the next major release, refactor the whole definition to:
35 // declare function pathKey(options?: pathKey.Options): string;
37 default: typeof pathKey;