{"name":"npm-run-path","version":"2.0.2","description":"Get your PATH prepended with locally installed binaries","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/npm-run-path.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["npm","run","path","package","bin","binary","binaries","script","cli","command-line","execute","executable"],"dependencies":{"path-key":"^2.0.0"},"devDependencies":{"ava":"*","xo":"*"},"xo":{"esnext":true},"gitHead":"4d956312d5da324c4eff435af7d80797f04f09e1","bugs":{"url":"https://github.com/sindresorhus/npm-run-path/issues"},"homepage":"https://github.com/sindresorhus/npm-run-path#readme","_id":"npm-run-path@2.0.2","_shasum":"35a9232dfa35d7067b4cb2ddf2357b1871536c5f","_from":".","_npmVersion":"3.10.3","_nodeVersion":"6.6.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"35a9232dfa35d7067b4cb2ddf2357b1871536c5f","tarball":"http://registry-npm.ywwl.com/npm-run-path/download/npm-run-path-2.0.2.tgz","integrity":"sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/fKm/MZ1tMKWwf9TaBfZfi3K3mnBlxP6BDzkRP8UeCQIgRjWe6LvzaiPg/mFUiN0+XVu2tojqWtylx7RlO9HPvR8="}],"size":2221,"noattachment":false,"key":"/npm-run-path/-/npm-run-path-2.0.2.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/npm-run-path-2.0.2.tgz_1475136638037_0.6285470693837851"},"directories":{},"readme":"# npm-run-path\n\n> Get your [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) prepended with locally installed binaries\n\nIn [npm run scripts](https://docs.npmjs.com/cli/run-script) you can execute locally installed binaries by name. This enables the same outside npm.\n\n## Install\n\n```sh\nnpm install npm-run-path\n```\n\n## Usage\n\n```js\nimport childProcess from 'node:child_process';\nimport {npmRunPath, npmRunPathEnv} from 'npm-run-path';\n\nconsole.log(process.env.PATH);\n//=> '/usr/local/bin'\n\nconsole.log(npmRunPath());\n//=> '/Users/sindresorhus/dev/foo/node_modules/.bin:/Users/sindresorhus/dev/node_modules/.bin:/Users/sindresorhus/node_modules/.bin:/Users/node_modules/.bin:/node_modules/.bin:/usr/local/bin'\n\n// `foo` is a locally installed binary\nchildProcess.execFileSync('foo', {\n\tenv: npmRunPathEnv()\n});\n```\n\n## API\n\n### npmRunPath(options?)\n\n`options`: [`Options`](#options)\\\n_Returns_: `string`\n\nReturns the augmented PATH string.\n\n### npmRunPathEnv(options?)\n\n`options`: [`Options`](#options)\\\n_Returns_: `object`\n\nReturns the augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object.\n\n### options\n\nType: `object`\n\n#### cwd\n\nType: `string | URL`\\\nDefault: `process.cwd()`\n\nThe working directory.\n\n#### execPath\n\nType: `string | URL`\\\nDefault: [`process.execPath`](https://nodejs.org/api/process.html#processexecpath)\n\nThe path to the current Node.js executable.\n\nThis can be either an absolute path or a path relative to the [`cwd` option](#cwd).\n\n#### addExecPath\n\nType: `boolean`\\\nDefault: `true`\n\nWhether to push the current Node.js executable's directory ([`execPath`](#execpath) option) to the front of PATH.\n\n#### preferLocal\n\nType: `boolean`\\\nDefault: `true`\n\nWhether to push the locally installed binaries' directory to the front of PATH.\n\n#### path\n\nType: `string`\\\nDefault: [`PATH`](https://github.com/sindresorhus/path-key)\n\nThe PATH to be appended.\n\nSet it to an empty string to exclude the default PATH.\n\nOnly available with [`npmRunPath()`](#npmrunpathoptions), not [`npmRunPathEnv()`](#npmrunpathenvoptions).\n\n#### env\n\nType: `object`\\\nDefault: [`process.env`](https://nodejs.org/api/process.html#processenv)\n\nAccepts an object of environment variables, like `process.env`, and modifies the PATH using the correct [PATH key](https://github.com/sindresorhus/path-key). Use this if you're modifying the PATH for use in the `child_process` options.\n\nOnly available with [`npmRunPathEnv()`](#npmrunpathenvoptions), not [`npmRunPath()`](#npmrunpathoptions).\n\n## Related\n\n- [npm-run-path-cli](https://github.com/sindresorhus/npm-run-path-cli) - CLI for this module\n- [execa](https://github.com/sindresorhus/execa) - Execute a locally installed binary\n","publish_time":1475136639751,"_cnpm_publish_time":1475136639751,"dist-tags":{"latest":"6.0.0"}}