Replacements for npm-run-all
npm-run-all2
npm-run-all2 is an actively maintained fork with important fixes, dependency updates.
json
{
"scripts": {
"build": "npm-run-all clean lint compile"
}
}
The commands remain the same: npm-run-all
, run-s
, and run-p
.
concurrently
Another option is concurrently, which focuses on running scripts in parallel with colored output and process control. It uses a slightly different syntax but works well for replacing the --parallel
use case.
json
{
"scripts": {
"dev": "npm-run-all --parallel \"watch-*\" start",
"dev": "concurrently \"npm:watch-*\" \"npm:start\""
}
}
Wireit
For more advanced workflows, consider Wireit. It integrates directly into package.json
to add caching, dependency graphs, watch mode, and incremental builds. Unlike npm-run-all
, Wireit upgrades your existing npm run
experience instead of providing a separate CLI.
json
{
"scripts": {
"build": "wireit",
"compile": "wireit",
"bundle": "wireit"
},
"wireit": {
"build": {
"dependencies": ["compile", "bundle"]
},
"compile": {
"command": "tsc",
"files": ["src/**/*.ts"],
"output": ["lib/**"]
},
"bundle": {
"command": "rollup -c",
"dependencies": ["compile"],
"files": ["rollup.config.js"],
"output": ["dist/**"]
}
}
}