Sha256: f4144a5f50958f9e653335abee760809605d6027137a52b496517b6abe013656

Contents?: true

Size: 967 Bytes

Versions: 75

Compression:

Stored size: 967 Bytes

Contents

# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key)

> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform

It's usually `PATH`, but on Windows it can be any casing like `Path`...


## Install

```
$ npm install --save path-key
```


## Usage

```js
const pathKey = require('path-key');

const key = pathKey();
//=> 'PATH'

const PATH = process.env[key];
//=> '/usr/local/bin:/usr/bin:/bin'
```


## API

### pathKey([options])

#### options

##### env

Type: `Object`<br>
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)

Use a custom environment variables object.

#### platform

Type: `string`<br>
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform)

Get the PATH key for a specific platform.


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)

Version data entries

75 entries across 74 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/path-key/readme.md
disco_app-0.18.0 test/dummy/node_modules/path-key/readme.md
disco_app-0.18.2 test/dummy/node_modules/path-key/readme.md
disco_app-0.16.1 test/dummy/node_modules/path-key/readme.md
disco_app-0.15.2 test/dummy/node_modules/path-key/readme.md
disco_app-0.18.4 test/dummy/node_modules/path-key/readme.md
disco_app-0.18.1 test/dummy/node_modules/path-key/readme.md
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/path-key/readme.md
disco_app-0.14.0 test/dummy/node_modules/path-key/readme.md
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/path-key/readme.md
tang-0.2.1 spec/tang_app/node_modules/path-key/readme.md
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/path-key/readme.md
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/path-key/readme.md
ruby2js-4.0.4 lib/tasks/testrails/node_modules/path-key/readme.md
ruby2js-4.0.3 lib/tasks/testrails/node_modules/path-key/readme.md
tang-0.2.0 spec/tang_app/node_modules/path-key/readme.md
tang-0.1.0 spec/tang_app/node_modules/path-key/readme.md
tang-0.0.9 spec/tang_app/node_modules/path-key/readme.md
enju_library-0.3.8 spec/dummy/node_modules/path-key/readme.md
jester-data-8.0.0 node_modules/path-key/readme.md