npm-run-path helps you prepend your local `node_modules/.bin` directories to the `PATH` when running commands in npm scripts. It exposes `npmRunPath()` (returns an updated PATH string) and `npmRunPathEnv()` (returns an updated `process.env` object), which is useful for executing locally installed binaries by name via Node.js child processes.
Project status
- The project appears actively maintained, with recent updates and an upstream push on 2024-10-28 (after the latest published update).
- Update cadence looks moderate, with versions v5.2.0 (2023-12-21), v5.3.0 (2024-02-23), and v6.0.0 (2024-08-26), suggesting periodic rather than continuous changes.
AI summary generated Today
Recent updates
v6.0.0
8/26/2024v6.0.0 raises the minimum supported Node.js version to 18 and improves PATH handling. It also adds idempotent behavior and better handling for empty PATH values.
Breakingv5.3.0
2/23/2024v5.3.0 adds two new options, `preferLocal` and `addExecPath`, to control which directories are prepended to `PATH`. The code introduces conditional logic around adding `node_modules/.bin` and the Node executable directory, while keeping existing defaults as `true` to preserve current behavior.
Featuresv5.2.0
12/21/2023v5.2.0 extends npm-run-path to accept file URLs for the execPath option, converting file:// URLs to filesystem paths before building PATH. The release notes only mention this execPath enhancement, but the diff also includes some packaging and repository maintenance changes.
Featuresv5.1.0
2/9/2022v5.1.0 adds support for passing `cwd` as a `URL` object instead of only a string. The implementation converts file URLs to filesystem paths and updates both runtime logic and TypeScript types/tests/docs accordingly.
Featuresv5.0.1
10/5/2021v5.0.1 is a very small patch release with only two modified files. The release notes claim it fixes a typo, but the provided diff shows a functional change in the main export.
v5.0.0
10/5/2021v5.0.0 of npm-run-path is a major release that switches the package to ESM and changes the public exports to named exports. The code diff also updates TypeScript typings and the environment helper API, in addition to bumping dependencies and adding CI configuration.
Breakingv4.0.1
12/22/2019v4.0.1 changes how npm-run-path constructs the PATH so that locally installed binaries take priority over the directory containing the running Node binary. The release notes specifically call out this priority change.
Breakingv4.0.0
10/14/2019v4.0.0 introduces an `execPath` option to control which Node.js executable directory is prepended to PATH. It also changes PATH ordering so the directory for the current Node executable (`process.execPath`) is placed before locally installed `node_modules/.bin` entries.
BreakingFeaturesv3.1.0
4/5/2019v3.1.0 primarily refactors the TypeScript declaration files for npm-run-path to better support CommonJS usage. The code diff shows changes focused on the public TypeScript typing surface and test/type tooling updates rather than runtime functionality.
v3.0.0
3/10/2019v3.0.0 introduces a breaking requirement to run on Node.js 8, which may require upgrading your runtime. It also adds TypeScript type definitions to improve developer experience when using the package in TypeScript projects.
BreakingFeatures