1. path-key
Get the PATH environment variable key cross-platform
path-key
Package: path-key
Created by: sindresorhus
Last modified: Sat, 17 Jun 2023 00:09:27 GMT
Version: 4.0.0
License: MIT
Downloads: 314,047,993
Repository: https://github.com/sindresorhus/path-key

Install

npm install path-key
yarn add path-key

path-key

Get the PATH 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

 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

Use a custom environment variables object.

platform

Type: string
Default: process.platform

Get the PATH key for a specific platform.


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin