Package Exports
- npm-run-all
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (npm-run-all) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
npm-run-all
A CLI tool to run multiple npm-scripts on sequential or parallel.
Installation
npm install npm-run-all
Usage
Usage: npm-run-all [OPTIONS] [...tasks]
Run specified tasks.
Options:
-h, --help Print this text.
-p, --parallel [...tasks] Grouping tasks to run on parallel.
-s, --sequential [...tasks] Grouping tasks to run on sequential.
-v, --version Print version number.
Run tasks on sequential
npm-run-all build:html build:js
This is same as npm run build:html && npm run build:js
.
Run tasks on parallel
npm-run-all --parallel watch:html watch:js
This is same as npm run watch:html & npm run watch:js
.
Of course, this can be run on Windows as well!
Run tasks on mixed sequential and parallel.
npm-run-all clean lint --parallel watch:html watch:js
- First, this runs
clean
andlint
sequentially. - Next, runs
build:html
andbuild:js
parallelly.
npm-run-all a b --parallel c d --sequential e f --parallel g h i
- First, runs
a
andb
sequentially. - Second, runs
c
andd
parallelly. - Third, runs
e
andf
sequentially. - Lastly, runs
g
,h
, andi
parallelly.
Node API
var runAll = require("npm-run-all");
runAll
var promise = runAll(tasks, options);
Run npm-scripts.
- tasks
string|string[]
-- Task names. - options
object
- options.parallel
boolean
-- A flag to run tasks on parallel. By default,false
. - options.stdin
stream.Readable
-- A readable stream that sends to stdin of tasks. By default, nothing. Setprocess.stdin
in order to send from key inputs. - options.stdout
stream.Writable
-- A writable stream that receives stdout of tasks. By default, nothing. Setprocess.stdout
in order to print to console. - options.stderr
stream.Writable
-- A writable stream that receives stderr of tasks. By default, nothing. Setprocess.stderr
in order to print to console.
- options.parallel
runAll
returns a promise that becomes fulfilled when done all tasks.
The promise will become rejected when any of tasks exited with non-zero code.