Run all build steps in parallel with one command instead of chaining them with fragile shell operators.
Replace '&&' and '&' in package.json scripts with cross-platform equivalents that work on Windows.
Run all scripts matching a pattern like 'build:*' without naming each one individually in the command.
Trigger multiple npm scripts programmatically from within your own Node.js code using the built-in API.
| mysticatea/npm-run-all | log4js-node/log4js-node | mikaelbr/node-notifier | |
|---|---|---|---|
| Stars | 5,838 | 5,838 | 5,840 |
| Language | JavaScript | JavaScript | JavaScript |
| Setup difficulty | easy | easy | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
When you build a JavaScript project, you often need to run a series of build steps: clean the output folder, compile CSS, compile JavaScript, process HTML templates. The usual way to chain those together in a package.json script is to write them out one after another with "&&" between each one, which gets long and repetitive quickly. This tool solves that by letting you group and run multiple npm scripts in a single short command. npm-run-all gives you three commands to work with. The main one, also called npm-run-all, handles both sequential and parallel execution and supports pattern matching so you can run all scripts that start with "build:" by just writing "build:*" instead of naming each one. The other two are shorthand versions: run-s runs scripts one after another in sequence, and run-p runs them all at the same time in parallel. The cross-platform angle matters here. On Mac and Linux, developers sometimes use the "&" character to run commands in parallel directly in the terminal. On Windows, that does not work. Since a large share of Node.js developers work on Windows, using "&" in shared project scripts can break things for contributors. This tool handles parallel execution in a way that works on all platforms without those issues. It is installed as a development dependency via npm or Yarn. The package also works correctly with Yarn, meaning if you invoke a script through Yarn, the child scripts it calls will also run through Yarn rather than npm. Beyond the command-line interface, the package includes a Node API if you want to trigger these script runs from within your own JavaScript code rather than from a terminal command. The README links out to separate documentation files for each command and the API, rather than putting all the details in the main page.
npm-run-all is a Node.js CLI tool that runs multiple npm scripts sequentially or in parallel with a single short command, and works correctly on Windows where the shell operators developers usually use do not.
Mainly JavaScript. The stack also includes JavaScript, Node.js, npm.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.