npm-run-all

A cross-platform CLI that runs multiple npm-scripts in parallel or in sequence, replacing fragile shell operators like && with Windows-safe orchestration.

Tool
npm
v4.1.5
5,834 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
46 /100 Fair
Development Activity 0
Maintenance 32
Community 52
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
67 /100 Good
Architecture 72
Code Quality 68
Innovation 48
Learning Curve 80

npm-run-all provides three CLI commands — npm-run-all, run-s, and run-p — for running several npm-scripts together without stitching together shell operators. Native npm only runs one script at a time, so developers historically chained commands with && (sequential) or & (parallel), but & doesn’t work in Windows’ cmd.exe, which npm run-script uses by default. npm-run-all sidesteps that by implementing its own cross-platform process orchestration, so the same script list behaves identically on Windows, macOS, and Linux.

Beyond simple chaining, it supports Glob-like patterns for matching multiple scripts by name (e.g. build:*), mixed sequential/parallel plans in one invocation, argument placeholders for forwarding CLI args into child scripts, a --continue-on-error flag, parallelism limits via --max-parallel, and a Node API for embedding the same orchestration logic directly in build scripts rather than shelling out.

What You Get

  • Three CLI entry points — npm-run-all (full-featured), run-s (sequential shorthand), and run-p (parallel shorthand) — for different levels of verbosity
  • Cross-platform parallel execution that works correctly on Windows’ cmd.exe, where the native & shell operator does not
  • Glob-like task name matching (e.g. build:**) so one pattern can target many npm-scripts in package.json
  • Mixed sequential-then-parallel execution plans in a single command, e.g. npm-run-all clean lint --parallel watch:html watch:js
  • A programmatic Node API (require('npm-run-all')) for embedding the same task-running logic inside custom build scripts
  • Yarn compatibility — scripts invoked via Yarn are re-run through Yarn rather than npm

Common Use Cases

  • Replacing a chain of npm run clean && npm run build:css && npm run build:js with a single npm-run-all clean build:* call
  • Running multiple watch processes (CSS, JS, server) together with run-p watch:* during local development
  • Aborting a multi-step CI build early with --continue-on-error disabled, so a failed lint or test step stops the pipeline
  • Limiting concurrency with --max-parallel when running many parallel tasks would overwhelm CI runner resources
  • Forwarding CLI arguments into individual npm-scripts using {1}/{@} placeholders instead of hardcoding them per script

Under The Hood

Architecture

The package is organized as a thin CLI layer (bin/npm-run-all, bin/run-s, bin/run-p) over a small library core (lib/index.js) that parses patterns, resolves them against package.json’s scripts field via lib/match-tasks.js (Glob matching through minimatch, with a TaskSet class deduping overlapping patterns), and executes them through lib/run-tasks.js and lib/run-task.js. Execution is Promise-based: run-tasks.js maintains a queue of pending tasks and a pool of in-flight promises sized by --max-parallel, spawning the next queued task as each finishes; a shared abort() path kills all in-flight child processes (including signal-to-exit-code translation per Node’s documented convention) the moment a task fails, unless --continue-on-error is set. Platform differences are isolated behind separate spawn-posix.js/spawn-win32.js modules so the parallel-abort and signal-handling logic in run-tasks.js stays platform-agnostic.

Tech Stack

Plain CommonJS JavaScript (no TypeScript), targeting Node >= 4, built and published without a bundler. Runtime dependencies are narrowly scoped to the problem: cross-spawn for portable child-process spawning, minimatch for Glob-style task matching, shell-quote for safely quoting forwarded arguments, memorystream for buffering aggregated output, pidtree for locating descendant processes to kill, chalk/ansi-styles for terminal coloring, and read-pkg for locating and parsing package.json. The project is transpiled with Babel only for async/await syntax support on older Node versions, tested with Mocha plus power-assert, and measures coverage with nyc/Istanbul. CI runs on both Travis (Linux, multiple Node versions down to 4.0.0) and AppVeyor (Windows), reflecting the project’s cross-platform mandate.

Code Quality

The library has a dedicated test/ directory covering parallel execution, sequential execution, mixed plans, argument placeholders, package-config overwrites, aggregated output, Yarn compatibility, print-label/print-name flags, and failure handling — run through Mocha with power-assert for expressive assertion failures and collected under nyc coverage. Source files carry consistent JSDoc annotations for every exported function and its parameters, and an ESLint config (extending a shared eslint-config-mysticatea ruleset) is enforced via a pretest hook, so lint failures block the test run. There is no static type system (plain JS, @types/node is a dev-only annotation aid), and error handling favors explicit Promise rejection with a custom NpmRunAllError type carrying structured per-task exit results rather than bare thrown strings.

What Makes It Unique

The library’s specific value is not running scripts — npm can already do that — but reproducing shell-level parallel/sequential composition (&&, &) in a way that is verified to behave identically across POSIX shells and Windows’ cmd.exe, including correctly propagating signal-based exit codes and killing descendant process trees on abort (via pidtree) rather than leaving orphaned child processes behind. Its Glob-pattern task matching and {1}/{@} argument-placeholder syntax let one invocation stand in for many differently-named scripts, which is a level of expressiveness beyond what shell chaining or npm’s own run command offers natively.

Used by 41 apps in this directory

TypeScript
61%
AGPL 3.0

Silex

Design Tools · No Code Platforms

3,000

Free, open-source visual website builder that exports clean HTML/CSS — no lock-in, no subscription, host anywhere

View details
89
Repo Health
68
Technical
67
Dependency
Built with
TypeScript 61%
Rust 15%
JavaScript 11%
Updated 2 weeks ago
TypeScript
97%
Other

Sourcebot

AI Code Assistants · Developer Tools · Search

3,985

A self-hosted, AI-powered code search engine that indexes every repo across GitHub, GitLab, Bitbucket, Gitea, Gerrit, and Azure DevOps, so both engineers and coding agents can search, browse, and ask questions about your codebase from one place.

View details
87
Repo Health
83
Technical
61
Dependency
Built with
TypeScript 97%
Updated 1 weeks ago
TypeScript
89%
Other

Hexclave

Authentication · Developer Tools

6,859

The open-source user infrastructure platform — authentication, teams, payments, emails, analytics, and more on a single unified user model.

View details
88
Repo Health
80
Technical
66
Dependency
Built with
TypeScript 89%
Updated 1 weeks ago
TypeScript
89%
Other

strapi

CMS

73,294

Open-source headless CMS that auto-generates REST and GraphQL APIs from your content models, with a fully customizable admin panel you control.

View details
93
Repo Health
84
Technical
63
Dependency
Built with
TypeScript 89%
JavaScript 11%
Updated 2 weeks ago
TypeScript
72%
Apache 2.0

Supabase

Authentication · Databases · Developer Tools

111,288

The open-source Postgres development platform that replaces Firebase with authentication, real-time APIs, edge functions, storage, and vector embeddings — all built on PostgreSQL.

View details
90
Repo Health
91
Technical
62
Dependency
Built with
TypeScript 72%
MDX 26%
Updated 1 weeks ago
JavaScript
93%
Apache 2.0

swagger-ui

Developer Tools

29,024

Transform OpenAPI specifications into interactive, browser-based API documentation that developers and consumers can explore and test live.

View details
98
Repo Health
83
Technical
65
Dependency
Built with
JavaScript 93%
Updated 2 weeks ago
Rust
93%
Other

Tabby

AI Code Assistants

33,904

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
56
Repo Health
78
Technical
61
Dependency
Built with
Rust 93%
Updated 3 months ago
TypeScript
68%
Other

TaskView

Productivity · Project Management

1,294

Self-hosted project and task management platform for software teams, with Kanban boards, sprints, time tracking, GitHub/GitLab integrations, and an MCP server for AI assistants.

View details
77
Repo Health
77
Technical
68
Dependency
Built with
TypeScript 68%
Vue 21%
Updated 2 weeks ago
HTML
68%
AGPL 3.0

ToolJet

AI Agents · Low Code Platforms · No Code Platforms

41,058

Open-source AI-native platform to build and deploy internal tools, workflows, and AI agents with a visual drag-and-drop builder and 80+ data source integrations.

View details
94
Repo Health
81
Technical
63
Dependency
Built with
HTML 68%
JavaScript 20%
Updated 1 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers