path-key

  • Version 4.0.0
  • Published
  • 4.07 kB
  • No dependencies
  • MIT license

Install

npm i path-key
yarn add path-key
pnpm add path-key

Overview

Get the PATH environment variable key cross-platform

Index

Functions

Interfaces

Functions

function pathKey

pathKey: (options?: Options) => string;
  • Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform.

    Example 1

    import pathKey from 'path-key';
    const key = pathKey();
    //=> 'PATH'
    const PATH = process.env[key];
    //=> '/usr/local/bin:/usr/bin:/bin'

Interfaces

interface Options

interface Options {}

    property env

    readonly env?: Record<string, string | undefined>;
    • Use a custom environment variables object.

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

    property platform

    readonly platform?: NodeJS.Platform;
    • Get the PATH key for a specific platform.

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

    Package Files (1)

    Dependencies (0)

    No dependencies.

    Dev Dependencies (4)

    Peer Dependencies (0)

    No peer dependencies.

    Badge

    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/path-key.

    • Markdown
      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/path-key)
    • HTML
      <a href="https://www.jsdocs.io/package/path-key"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>