diff options
Diffstat (limited to 'node_modules/path-key')
| -rw-r--r-- | node_modules/path-key/index.js | 13 | ||||
| -rw-r--r-- | node_modules/path-key/license | 21 | ||||
| -rw-r--r-- | node_modules/path-key/package.json | 75 | ||||
| -rw-r--r-- | node_modules/path-key/readme.md | 51 | 
4 files changed, 160 insertions, 0 deletions
diff --git a/node_modules/path-key/index.js b/node_modules/path-key/index.js new file mode 100644 index 0000000..62c8250 --- /dev/null +++ b/node_modules/path-key/index.js @@ -0,0 +1,13 @@ +'use strict'; +module.exports = opts => { +	opts = opts || {}; + +	const env = opts.env || process.env; +	const platform = opts.platform || process.platform; + +	if (platform !== 'win32') { +		return 'PATH'; +	} + +	return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path'; +}; diff --git a/node_modules/path-key/license b/node_modules/path-key/license new file mode 100644 index 0000000..654d0bf --- /dev/null +++ b/node_modules/path-key/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/node_modules/path-key/package.json b/node_modules/path-key/package.json new file mode 100644 index 0000000..7bee704 --- /dev/null +++ b/node_modules/path-key/package.json @@ -0,0 +1,75 @@ +{ +  "_args": [ +    [ +      "path-key@2.0.1", +      "/home/dstaesse/git/website" +    ] +  ], +  "_development": true, +  "_from": "path-key@2.0.1", +  "_id": "path-key@2.0.1", +  "_inBundle": false, +  "_integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", +  "_location": "/path-key", +  "_phantomChildren": {}, +  "_requested": { +    "type": "version", +    "registry": true, +    "raw": "path-key@2.0.1", +    "name": "path-key", +    "escapedName": "path-key", +    "rawSpec": "2.0.1", +    "saveSpec": null, +    "fetchSpec": "2.0.1" +  }, +  "_requiredBy": [ +    "/npm-run-path" +  ], +  "_resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", +  "_spec": "2.0.1", +  "_where": "/home/dstaesse/git/website", +  "author": { +    "name": "Sindre Sorhus", +    "email": "sindresorhus@gmail.com", +    "url": "sindresorhus.com" +  }, +  "bugs": { +    "url": "https://github.com/sindresorhus/path-key/issues" +  }, +  "description": "Get the PATH environment variable key cross-platform", +  "devDependencies": { +    "ava": "*", +    "xo": "*" +  }, +  "engines": { +    "node": ">=4" +  }, +  "files": [ +    "index.js" +  ], +  "homepage": "https://github.com/sindresorhus/path-key#readme", +  "keywords": [ +    "path", +    "key", +    "environment", +    "env", +    "variable", +    "var", +    "get", +    "cross-platform", +    "windows" +  ], +  "license": "MIT", +  "name": "path-key", +  "repository": { +    "type": "git", +    "url": "git+https://github.com/sindresorhus/path-key.git" +  }, +  "scripts": { +    "test": "xo && ava" +  }, +  "version": "2.0.1", +  "xo": { +    "esnext": true +  } +} diff --git a/node_modules/path-key/readme.md b/node_modules/path-key/readme.md new file mode 100644 index 0000000..cb5710a --- /dev/null +++ b/node_modules/path-key/readme.md @@ -0,0 +1,51 @@ +# path-key [](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)  | 
