# path-key

> Get the PATH environment variable key cross-platform

Latest version **4.0.0** (published 2021-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install path-key
pnpm add path-key
yarn add path-key
bun add path-key
```

## Health

**Score 28/100 (F)** — status: abandoned.

Positive: has types package; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-04-09 |
| First published | 2015-12-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/path-key) |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 46 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | path, key, environment, env, variable, get, cross-platform, windows |

## Links

- npm: https://www.npmjs.com/package/path-key
- Repository: https://github.com/sindresorhus/path-key
- Homepage: https://github.com/sindresorhus/path-key#readme
- Issues: https://github.com/sindresorhus/path-key/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/path-key

## Alternatives

- [replicas-cli](https://npm.io/package/replicas-cli.md) — 3.0K weekly downloads
- [env-contract](https://npm.io/package/env-contract.md) — 133 weekly downloads
- [@openveo/api](https://npm.io/package/@openveo/api.md) — 61 weekly downloads
- [@ryniaubenpm2/cumque-error-reiciendis](https://npm.io/package/@ryniaubenpm2/cumque-error-reiciendis.md) — 54 weekly downloads
- [ts-global-type-extra](https://npm.io/package/ts-global-type-extra.md) — 11 weekly downloads

## Recent versions

- 4.0.0 (latest) — 2021-04-09
- 3.1.1 — 2019-11-22
- 3.1.0 — 2019-04-05
- 3.0.0 — 2019-03-10
- 2.0.1 — 2016-09-26
- 2.0.0 — 2016-09-25
- 1.0.0 — 2015-12-28

## README

# 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 path-key
```

## Usage

```js
import pathKey from 'path-key';

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

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

## API

### pathKey(options?)

#### options

Type: `object`

##### env

Type: `object`\
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)

Use a custom environment variables object.

#### platform

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

Get the PATH key for a specific platform.

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

---
_Source: https://npm.io/package/path-key · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
