API Reference

npm-run-all

CLI utility to run multiple npm scripts sequentially or in parallel with glob matching and argument passing.

Official Documentation ↗
CompatibilityThis documentation covers version v4. Check the official docs for the latest API surface.

Installation

npmnpm install --save-dev npm-run-all
pnpmpnpm add -D npm-run-all

Methods

Overview

npm-run-all is a small CLI that runs several npm scripts in a defined order or concurrently, with glob matching and argument forwarding. This reference lists the most frequently used APIs with accurate signatures and runnable snippets.

Core APIs

  • run-s — Runs the listed npm scripts sequentially in the given order.
  • run-p — Runs the listed npm scripts in parallel and reports failures.
  • npm-run-all — Runs scripts serially by default with flags to switch to parallel or keep going on errors.

Example

# lint then test, stopping on the first failure
run-s lint test

Notes

Sequential runs stop at the first failure, which is usually what CI wants. Use the parallel variant only for tasks that can safely overlap.

Verification

Compose a run-s chain of two scripts and confirm the second only starts after the first exits with code 0.

FAQ

How do I match multiple scripts by pattern?
Use a glob such as "build:*"; npm-run-all expands it to matching scripts in package.json and runs each.
How do I pass arguments to the underlying scripts?
Append them after --, for example run-s "lint -- --fix", so arguments reach the spawned npm script.
How do I prevent parallel tasks from hiding failures?
Because run-p fails fast by default, keep failures visible; use --continue-on-error only when partial progress is acceptable.