path-key
Advanced tools
Comparing version 2.0.1 to 3.0.0
12
index.js
'use strict'; | ||
module.exports = opts => { | ||
opts = opts || {}; | ||
const env = opts.env || process.env; | ||
const platform = opts.platform || process.platform; | ||
const pathKey = (options = {}) => { | ||
const environment = options.env || process.env; | ||
const platform = options.platform || process.platform; | ||
@@ -12,3 +11,6 @@ if (platform !== 'win32') { | ||
return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; | ||
return Object.keys(environment).find(key => key.toUpperCase() === 'PATH') || 'Path'; | ||
}; | ||
module.exports = pathKey; | ||
module.exports.default = pathKey; |
{ | ||
"name": "path-key", | ||
"version": "2.0.1", | ||
"description": "Get the PATH environment variable key cross-platform", | ||
"license": "MIT", | ||
"repository": "sindresorhus/path-key", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"path", | ||
"key", | ||
"environment", | ||
"env", | ||
"variable", | ||
"var", | ||
"get", | ||
"cross-platform", | ||
"windows" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
}, | ||
"xo": { | ||
"esnext": true | ||
} | ||
"name": "path-key", | ||
"version": "3.0.0", | ||
"description": "Get the PATH environment variable key cross-platform", | ||
"license": "MIT", | ||
"repository": "sindresorhus/path-key", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd-check" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
"path", | ||
"key", | ||
"environment", | ||
"env", | ||
"variable", | ||
"var", | ||
"get", | ||
"cross-platform", | ||
"windows" | ||
], | ||
"devDependencies": { | ||
"@types/node": "^11.11.0", | ||
"ava": "^1.3.1", | ||
"tsd-check": "^0.3.0", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -11,3 +11,3 @@ # path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key) | ||
``` | ||
$ npm install --save path-key | ||
$ npm install path-key | ||
``` | ||
@@ -35,2 +35,4 @@ | ||
Type: `Object` | ||
##### env | ||
@@ -37,0 +39,0 @@ |
Sorry, the diff of this file is not supported yet
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
3721
5
26
54
0
4