npm-run-all
A CLI tool to run multiple npm-scripts in parallel or sequential.
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.