{"name":"npm-path","version":"2.0.4","description":"Get a PATH with all executables available to npm scripts.","main":"index.js","bin":{"npm-path":"bin/npm-path"},"scripts":{"clean":"rimraf build-test && (rm *.js || true)","prebuild":"npm run clean","build":"babel src --out-dir . && babel test --out-dir build-test","prepublish":"not-in-publish || npm run build","tests-only":"tape build-test -r airbnb-js-shims | faucet","pretest":"standard src/* test/* bin/*","test":"npm run build && npm run tests-only"},"author":{"name":"Tim Oxley"},"license":"MIT","engines":{"node":">=0.8"},"devDependencies":{"airbnb-js-shims":"^1.4.0","babel-cli":"^6.26.0","babel-preset-airbnb":"^2.4.0","babel-register":"^6.26.0","faucet":"0.0.1","in-publish":"^2.0.0","npm":"^3.10.10","rimraf":"^2.6.2","standard":"^7.1.2","tape":"^4.8.0"},"dependencies":{"which":"^1.2.10"},"directories":{"test":"test"},"repository":{"type":"git","url":"git+https://github.com/timoxley/npm-path.git"},"keywords":["npm","run","executable"],"bugs":{"url":"https://github.com/timoxley/npm-path/issues"},"homepage":"https://github.com/timoxley/npm-path","gitHead":"71ba97c8d4129cb335d1d66aeb05526829f62372","_id":"npm-path@2.0.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.1","_npmUser":{"name":"timoxley","email":"secoif@gmail.com"},"dist":{"integrity":"sha512-IFsj0R9C7ZdR5cP+ET342q77uSRdtWOlWpih5eC+lu29tIDbNEgDbzgVJ5UFvYHWhxDZ5TFkJafFioO0pPQjCw==","shasum":"c641347a5ff9d6a09e4d9bce5580c4f505278e64","tarball":"http://registry-npm.ywwl.com/npm-path/download/npm-path-2.0.4.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEFu6AdRz34dPGsvDpZR/R5yz/A8X2SUdgnP45qFaIkxAiBdEq5vfIS/ohzLtsXru6W4pYiD/aaCY0aSdpJ6430wvQ=="}],"size":8119,"noattachment":false,"key":"/npm-path/-/npm-path-2.0.4.tgz"},"maintainers":[{"name":"timoxley","email":"secoif@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-path-2.0.4.tgz_1515229346160_0.10402124701067805"},"readme":"# npm-path\n\n### Get a PATH containing locally installed module executables.\n\n`npm-path` will get you a PATH with all of the executables available to npm scripts, without booting up all of npm(1).\n\n#### `npm-path` will set your PATH to include:\n\n* All of the `node_modules/.bin` directories from the current directory, up through all of its parents. This allows you to invoke the executables for any installed modules. e.g. if `mocha` is installed a dependency of the current module, then `mocha` will be available on a `npm-path` generated `$PATH`.\n* The directory containing the current `node` executable, so any scripts that invoke `node` will execute the same `node`.\n* Current npm's `node-gyp` directory, so the `node-gyp` bundled with `npm` can be used.\n\n## Usage\n\n### Command-line\n\n```bash\n# Prints the augmented PATH to the console\n> npm-path\n# /usr/local/lib/node_modules/npm/bin/node-gyp-bin:.../node_modules/.bin:/.../usr/local/bin:/usr/local/sbin: ... etc\n```\n\nCalling `npm-path` from the commandline is the equivalent of executing an npm script with the body `echo $PATH`, but without all of the overhead of booting or depending on `npm`.\n\n### Set PATH\n\nThis will set the augmented PATH for the current process environment, or an environment you supply.\n\n```js\nvar npmPath = require('npm-path')\nvar PATH = npmPath.PATH // get platform independent PATH key\n\nnpmPath(function(err, $PATH) {\n  \n  // Note: current environment is modified!\n  console.log(process.env[PATH] == $PATH) // true\n  \n  console.log($PATH)\n  // /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/.../.bin:/usr/local/bin: ...etc\n  \n})\n\n// more explicit alternative syntax\nnpmPath.set(function(err, $PATH) {\n  // ...\n})\n```\n\n#### Synchronous Alternative\n\n```js\n\n//  supplying no callback will execute method synchronously\nvar $PATH = npmPath()\nconsole.log($PATH)\n\n// more explicit alternative syntax\n$PATH = npmPath.setSync()\n```\n\n#### Optional Options\n\n```js\nvar options = {\n  env: process.env, // default.\n  cwd: process.cwd() // default.\n}\n\nnpmPath(options, function(err, $PATH) {\n  // ...\n})\n\nnpmPath.setSync(options)\n\n  // ...\n\n```\n\n\n### Get PATH\n\nThis will get npm augmented PATH, but *does not modify the PATH in the environment*.\nTakes the exact same options as `set`.\n\n```js\nnpmPath.get(function(err, $PATH) {\n  console.log($PATH)\n  \n  // Note: current environment is NOT modified!\n  console.log(process.env[PATH] == $PATH) // false\n})\n\n// options is optional, takes same options as `npmPath.set`\nnpmPath.get(options, function(err, $PATH) {\n  console.log($PATH)\n})\n```\n\n#### Synchronous Alternative\n\n```js\n//  supplying no callback will execute method synchronously\nvar $PATH = npmPath.get()\nconsole.log($PATH)\nconsole.log(process.env[PATH] == $PATH) // false\n\n// more explicit alternative syntax\n$PATH = npmPath.getSync()\n\n```\n\n### Options\n\nBoth `set` and `get` take an optional options object, with optional `env` & `cwd` keys.\n\n* Set `options.env` if you wish to use something other than `process.env` (the default)\n* Set `options.cwd` if you wish to use something other than `process.cwd()` (the default)\n\nThere's also a `options.npm` property which you can set if you want `node-gyp` to be sourced from\nan alternative `npm` installation.\n\n### Get the PATH environment variable key\n\n```js\n// windows calls it's path \"Path\" usually, but this is not guaranteed.\nnpmPath.PATH // 'Path', probably\n\n// rest of the world\nnpmPath.PATH // 'PATH'\n\n```\n\n#### Example Usage\n\n```js\nprocess.env[npmPath.PATH] // get path environment variable\n\n// set path environment variable manually\nprocess.env[npmPath.PATH] = npmPath.get()\n\n// set path environment variable automatically\nnpmPath()\n```\n\n### Get the PATH separator\n\n```js\n// windows\nnpmPath.SEPARATOR // ';'\n\n// rest of the world\nnpmPath.SEPARATOR // ':'\n```\n\n## Credit\n\nPath lookup code adapted directly from npm.\n\nThanks to [Jordan Harband](https://github.com/ljharb) for his [hard work](https://github.com/timoxley/npm-path/pulls?q=is%3Apr+author%3Aljharb) adapting this to work on node 0.8.\n\n# License\n\nMIT\n","publish_time":1515229346237,"_cnpm_publish_time":1515229346237,"dist-tags":{"latest":"2.0.4"}}