{"name":"npm-run-path","version":"3.0.0","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":">=8"},"scripts":{"test":"xo && ava && tsd-check"},"keywords":["npm","run","path","package","bin","binary","binaries","script","cli","command-line","execute","executable"],"dependencies":{"path-key":"^3.0.0"},"devDependencies":{"ava":"^1.3.1","tsd-check":"^0.3.0","xo":"^0.24.0"},"gitHead":"74fca6345b0ddc06c8e4e9e5587e1e2594a28e06","bugs":{"url":"https://github.com/sindresorhus/npm-run-path/issues"},"homepage":"https://github.com/sindresorhus/npm-run-path#readme","_id":"npm-run-path@3.0.0","_nodeVersion":"10.15.1","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-42wmNM/F44tq5pDfDDwYWh30JbQokeUn79/6qNyoEvCSOMy0Q2iHe7unLRzRWQL5JLrOoQT6WzSuc6ylvEMmNg==","shasum":"9bbd1824407d510ef3576c5ebc8b418dead140d9","tarball":"http://registry-npm.ywwl.com/npm-run-path/download/npm-run-path-3.0.0.tgz","fileCount":5,"unpackedSize":6069,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJchSxuCRA9TVsSAnZWagAAOjMP/iWz+r6+vdCG8uP2gUgf\nMxz6yTYrUTjsr7pUIZjHRsd6pxTF1sgLWnxi0fJIDbizKR/t+MhaC/cIbVUA\n0iLYc0jK2l+U7LyZ1HSPWzQ7Btqu7omSnW7NCHhk7voVzUT/BqKyJbQfEtaw\nAxiabuc9FOiEhyICAHNM0DOmJlApRdtecgo9Kw9M8dORyYZxgdVn7aZkPsc8\n38mPs/W7IZz1qJRv6hkeWvCag4J++/UGKgCINgqAkIW4Y5/Kd+ChGe+u3ZSt\nH1/Q4TQ6TCbC05dai28W1RxN0tp8NPsaMNH7PGy6oYV7cK6LTwV3HUfF73vJ\n+1ULSW2yOOQ8I9M2Zp4xQEeC0dGV1jZF/kTfaDrJnrpExkzbmSUPIKYh3zyb\nSTZ9X71gaNgupLfpi4pADkGCvIoNBCAhbof16Tj/pcu0hFs9JFCzBMKy6di+\n4JZBc+KKr1tkETyUlExeoloEFAdl3iQvr50n/wHLhggdIMNu8TkNieiYIOxm\nEDfSGKnuipETR0+LWQ9E+WOVghRYk0NROeSUqFO3H1+p3eCDzNv5VKyVEbnd\nIHEvP5e6bU7kYQG9P8q8zaotiZFWGPmJodFtU9Py3BJFJ77b0MEOPbBESWTA\nXg0fjgtJvfhJO2HkokqgbqjxfMnbe2+q+Ld2BiIu6H+gkmQBAMxYIARXFJOF\nAbEN\r\n=Njue\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDOFeP+9iTqyWiMNnPXjjrT953uaAoC7knt9bdGwtBleAiEAlyJhzUnZJOV9lDB+xfMiOiwM85DPhK9KFICjwhrTRTU="}],"size":2483,"noattachment":false,"key":"/npm-run-path/-/npm-run-path-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-run-path_3.0.0_1552231534136_0.9456079331176104"},"_hasShrinkwrap":false,"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":1552231534328,"_cnpm_publish_time":1552231534328,"dist-tags":{"latest":"6.0.0"}}