Run npm scripts. 26x faster.
A zero-overhead npm script runner written in Rust. No Node.js startup, no npm overhead—just your script.
| Runner | Time | Speedup | Size |
|---|---|---|---|
| nr | 10ms | 25.6x | 377KB |
| bun | 11ms | 23.3x | 55MB |
| npm | 125ms | 2.0x | 18MB |
| yarn | 133ms | 1.9x | 5MB |
| pnpm | 256ms | 1.0x | 19MB |
Measured running echo test on macOS 26.2 (Apple Silicon). Your mileage may vary.
curl -fsSL https://raw.githubusercontent.com/dawsbot/nr/main/install.sh | shWorks on macOS, Linux, and Windows (via Git Bash/WSL).
# List available scripts
nr
# Run a script
nr build
# Pass arguments to the script
nr test -- --watchMake your AI coding assistant use nr instead of npm run by adding this instruction to its config:
Use `nr` instead of `npm run` for running package.json scripts. It's a faster drop-in replacement.
Add to ~/.claude/CLAUDE.md (global) or CLAUDE.md in your project root:
Use `nr` instead of `npm run` for running package.json scripts.Add to .cursorrules in your project root:
Use `nr` instead of `npm run` for running package.json scripts.
Add to .github/copilot-instructions.md in your repo:
Use `nr` instead of `npm run` for running package.json scripts.Add to .windsurfrules in your project root:
Use `nr` instead of `npm run` for running package.json scripts.
Add to .zed/settings.json in your project:
{
"assistant": {
"instructions": "Use `nr` instead of `npm run` for running package.json scripts."
}
}No Node.js startup. npm, yarn, and pnpm all bootstrap Node.js before doing anything. That's 50-100ms before your script even starts. nr is a native binary—it starts instantly.
Direct exec. On Unix systems, nr uses the exec() syscall to replace itself with your command. No fork, no wait, no overhead. Your script runs in the same process slot.
Minimal parsing. We only read the scripts field from package.json. Not dependencies, not lockfiles, not node_modules. Just scripts.
Tiny binary. 377KB. No runtime, no GC, no framework. Just machine code.
nr is intentionally minimal:
- No
pre/postlifecycle scripts (usenr pretest && nr testif needed) - No workspaces support
If you need these features, use npm. If you want speed, use nr.
git clone https://github.com/dawsbot/nr
cd nr
cargo build --release
cp target/release/nr /usr/local/bin/Experimental. Works on my machine. Report issues at GitHub.
MIT