{"_id":"@cjser/npm-run-path__v5_3_0","name":"@cjser/npm-run-path__v5_3_0","dist-tags":{"latest":"5.3.0-cjser.2"},"versions":{"5.3.0-cjser.2":{"name":"@cjser/npm-run-path__v5_3_0","version":"5.3.0-cjser.2","description":"Get your PATH prepended with locally installed binaries","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"types":"./index.d.ts","sideEffects":false,"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":{"@cjser/path-key":"4.0.0-cjser.2"},"devDependencies":{"ava":"^3.15.0","tsd":"^0.17.0","xo":"^0.45.0"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"5.3.0","cjserVersion":2,"original":{"name":"npm-run-path","version":"5.3.0","exports":"./index.js","repository":"sindresorhus/npm-run-path","dependencies":{"path-key":"^4.0.0"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/npm-run-path__v5_3_0@5.3.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-0lE1hogH/nEuCkMtYUcFQivT15DAssweZe7YowJ4hEz6Kml0uEgwEqoEK1s+q7y3DRya/od767ZgChvPMp3oiw==","shasum":"fc04b1704540c179da9359e58cd8bf3dc319f7fb","tarball":"https://registry.npmjs.org/@cjser/npm-run-path__v5_3_0/-/npm-run-path__v5_3_0-5.3.0-cjser.2.tgz","fileCount":6,"unpackedSize":12885,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDuCWSuK3sF/L3XVZAbpivVKuVo6Aa5GupDjyqdHUg02QIgViON16ws71m+HSufLXGZktHmi1gsFN2hNnNlbDCaM58="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/npm-run-path__v5_3_0_5.3.0-cjser.2_1778159205436_0.9773860715412748"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:06:45.284Z","5.3.0-cjser.2":"2026-05-07T13:06:45.587Z","modified":"2026-05-07T13:06:45.820Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Get your PATH prepended with locally installed binaries","keywords":["npm","run","path","package","bin","binary","binaries","script","cli","command-line","execute","executable"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/npm-run-path\n","readmeFilename":"readme.md","_rev":"1-249e03675c56fbc5993fbc467a5ffcdc"}