{"name":"npm-run-path","version":"5.0.1","description":"Get your PATH prepended with locally installed binaries","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/npm-run-path.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["npm","run","path","package","bin","binary","binaries","script","cli","command-line","execute","executable"],"dependencies":{"path-key":"^4.0.0"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.45.0"},"gitHead":"d44e51582c1c66321cc0d3811396d0e6fc44a92c","bugs":{"url":"https://github.com/sindresorhus/npm-run-path/issues"},"homepage":"https://github.com/sindresorhus/npm-run-path#readme","_id":"npm-run-path@5.0.1","_nodeVersion":"12.22.1","_npmVersion":"7.20.3","dist":{"integrity":"sha512-ybBJQUSyFwEEhqO2lXmyKOl9ucHtyZBWVM0h0FiMfT/+WKxCUZFa95qAR2X3w/w6oigN3B0b2UNHZbD+kdfD5w==","shasum":"748dd68ed7de377bb1f7132c7dafe657be5ab400","tarball":"http://registry-npm.ywwl.com/npm-run-path/download/npm-run-path-5.0.1.tgz","fileCount":5,"unpackedSize":7884,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh21Y0CRA9TVsSAnZWagAAZjkP/15sAWsFE6yqrk7fmKh9\nFqQRr3fdPmPtwcPFuHc3CnGQVDHfC+nUy3Osf3JhcpdXOpoArBb8NjFkLc+W\npI6RdtJmlK3W5q0GN8p11ulpjU2gN3v+9KASXMD3kI22S0CMyCmDgumnrBBa\nb2jiXmbQcpaK2ZmBI6sspXpg3bfHbd4gb5WlRUQh+siNZNzuK1xDj+T986ku\n3DpZfvAUCw5eKrde/zEMOAPqiw+Yh9hBVSAMaLdqIoUEj6ZkfXuOiy9b+/y8\n3ZYkD4JtGvDx9reT4JM36n+cafdtkQnhWp9b/1JN6y5gILdvI8BO5bQBqYEb\nxzcFAJbZ2x6PqOim1VJRHqPBKn/HgG0b2+mdPj5Q3ceirTA8Arfj4IstL4Bn\nxggI2DicV5bljSNvLaoWIYz3hO+dP+lLhMn5tqopuTQDchxn3/+O+b5afIrr\njMItoI8AqN9OE22+KhZzHzhrHhcYv1rz5wQgLsQRRmTyWxmf8bfvzwDBKSIx\nJarMISlL6C1KeuwuGcgr/GWttEWH98aw66N54MtzvTfxpQDkEdehfsPVDidT\nPxHzFHXjQofpbDH6kOTQb2KqNIhIXJuAPjK+VpC5gOAdnuYBR5r1KmgahRfz\nSIpKw68PxRMSSDkW1P1kVUPLeDYjCAZU1+asaqKoHvLYaUYAbZyxxkCp0YdI\nr4x0\r\n=kqg7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD47ZJQ21LvquWcb7Keuu+krRYURL5ZkH6ry72DlXbeDgIgFrm8vTkEoFotqM32OA6VAM2mssv4K/gGLwnUdCKEP54="}],"size":2848,"noattachment":false,"key":"/npm-run-path/-/npm-run-path-5.0.1.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/npm-run-path_5.0.1_1633420454843_0.3625301046160667"},"_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":1633420454961,"_cnpm_publish_time":1633420454961,"dist-tags":{"latest":"6.0.0"}}