concurrently
Advanced tools
Comparing version 3.6.1 to 4.0.0
{ | ||
"name": "concurrently", | ||
"version": "3.6.1", | ||
"version": "4.0.0", | ||
"description": "Run commands concurrently", | ||
"main": "src/main.js", | ||
"main": "index.js", | ||
"bin": { | ||
"concurrent": "./src/main.js", | ||
"concurrently": "./src/main.js" | ||
"concurrently": "./bin/concurrently.js" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=6.0.0" | ||
}, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "mocha", | ||
"echo": "echo", | ||
"echo-test": "echo test", | ||
"echo-sound-beep": "echo beep", | ||
"echo-sound-boop": "echo boop" | ||
"lint": "eslint . --ignore-path .gitignore", | ||
"test": "jest" | ||
}, | ||
@@ -35,29 +30,29 @@ "repository": { | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/kimmobrunfeldt/concurrently/issues" | ||
}, | ||
"homepage": "https://github.com/kimmobrunfeldt/concurrently", | ||
"dependencies": { | ||
"chalk": "^2.4.1", | ||
"commander": "2.6.0", | ||
"date-fns": "^1.23.0", | ||
"lodash": "^4.5.1", | ||
"read-pkg": "^3.0.0", | ||
"rx": "2.3.24", | ||
"lodash": "^4.17.10", | ||
"read-pkg": "^4.0.1", | ||
"rxjs": "6.2.2", | ||
"spawn-command": "^0.0.2-1", | ||
"supports-color": "^3.2.3", | ||
"tree-kill": "^1.1.0" | ||
"supports-color": "^4.5.0", | ||
"tree-kill": "^1.1.0", | ||
"yargs": "^12.0.1" | ||
}, | ||
"devDependencies": { | ||
"chai": "^1.10.0", | ||
"eslint": "^4.19.1", | ||
"mocha": "^2.1.0", | ||
"mustache": "^1.0.0", | ||
"releasor": "^1.2.1", | ||
"semver": "^4.2.0", | ||
"shell-quote": "^1.4.3", | ||
"shelljs": "^0.3.0", | ||
"sinon": "^4.1.3", | ||
"string": "^3.0.0" | ||
"eslint": "^5.4.0", | ||
"jest": "^23.5.0", | ||
"jest-create-mock-instance": "^1.1.0" | ||
}, | ||
"jest": { | ||
"collectCoverage": true, | ||
"collectCoverageFrom": [ | ||
"src/**/*.js" | ||
], | ||
"coveragePathIgnorePatterns": [ | ||
"/fixtures/", | ||
"/node_modules/" | ||
], | ||
"testEnvironment": "node" | ||
} | ||
} |
216
README.md
@@ -12,2 +12,20 @@ # Concurrently | ||
**Table of contents** | ||
- [Why](#why) | ||
- [Install](#install) | ||
- [Usage](#usage) | ||
- [Programmatic Usage](#programmatic-usage) | ||
- [FAQ](#faq) | ||
## Why | ||
I like [task automation with npm](http://substack.net/task_automation_with_npm_run) | ||
but the usual way to run multiple commands concurrently is | ||
`npm run watch-js & npm run watch-css`. That's fine but it's hard to keep | ||
on track of different outputs. Also if one process fails, others still keep running | ||
and you won't even notice the difference. | ||
Another option would be to just run all commands in separate terminals. I got | ||
tired of opening terminals and made **concurrently**. | ||
**Features:** | ||
@@ -96,61 +114,66 @@ | ||
Usage: concurrently [options] <command ...> | ||
concurrently [options] <command ...> | ||
Options: | ||
General | ||
-n, --names List of custom names to be used in prefix template. | ||
Example names: "main,browser,server" [string] | ||
--name-separator The character to split <names> on. Example usage: | ||
concurrently -n "styles|scripts|server" --name-separator "|" | ||
[default: ","] | ||
-r, --raw Output only raw output of processes, disables prettifying | ||
and concurrently coloring. [boolean] | ||
-s, --success Return exit code of zero or one based on the success or | ||
failure of the "first" child to terminate, the "last child", | ||
or succeed only if "all" child processes succeed. | ||
[choices: "first", "last", "all"] [default: "all"] | ||
--no-color Disables colors from logging [boolean] | ||
-h, --help output usage information | ||
-V, --version output the version number | ||
-k, --kill-others kill other processes if one exits or dies | ||
--kill-others-on-fail kill other processes if one exits with non zero status code | ||
--no-color disable colors from logging | ||
-p, --prefix <prefix> prefix used in logging for each process. | ||
Possible values: index, pid, time, command, name, none, or a template. Default: index or name (when --names is set). Example template: "{time}-{pid}" | ||
Prefix styling | ||
-p, --prefix Prefix used in logging for each process. | ||
Possible values: index, pid, time, command, name, | ||
none, or a template. Example template: "{time}-{pid}" | ||
[string] [default: index or name (when --names is set)] | ||
-c, --prefix-colors Comma-separated list of chalk colors to use on | ||
prefixes. If there are more commands than colors, the | ||
last color will be repeated. | ||
- Available modifiers: reset, bold, dim, italic, | ||
underline, inverse, hidden, strikethrough | ||
- Available colors: black, red, green, yellow, blue, | ||
magenta, cyan, white, gray | ||
- Available background colors: bgBlack, bgRed, | ||
bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite | ||
See https://www.npmjs.com/package/chalk for more | ||
information. [string] [default: "gray.dim"] | ||
-l, --prefix-length Limit how many characters of the command is displayed | ||
in prefix. The option can be used to shorten the | ||
prefix when it is set to "command" | ||
[number] [default: 10] | ||
-t, --timestamp-format Specify the timestamp in moment/date-fns format. | ||
[string] [default: "YYYY-MM-DD HH:mm:ss.SSS"] | ||
-n, --names <names> List of custom names to be used in prefix template. | ||
Example names: "main,browser,server" | ||
Input handling | ||
-i, --handle-input Whether input should be forwarded to the child | ||
processes. See examples for more information.[boolean] | ||
--default-input-target Identifier for child process to which input on stdin | ||
should be sent if not specified at start of input. | ||
Can be either the index or the name of the process. | ||
[default: 0] | ||
--name-separator <char> The character to split <names> on. | ||
Default: ",". Example usage: concurrently -n "styles,scripts|server" --name-separator "|" <command ...> | ||
Killing other processes | ||
-k, --kill-others kill other processes if one exits or dies [boolean] | ||
--kill-others-on-fail kill other processes if one exits with non zero status | ||
code [boolean] | ||
-c, --prefix-colors <colors> Comma-separated list of chalk colors to use on prefixes. If there are more commands than colors, the last color will be repeated. | ||
Available modifiers: reset, bold, dim, italic, underline, inverse, hidden, strikethrough | ||
Available colors: black, red, green, yellow, blue, magenta, cyan, white, gray | ||
Available background colors: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite | ||
See https://www.npmjs.com/package/chalk for more information. | ||
Default: "gray.dim". Example: "black.bgWhite,cyan,gray.dim" | ||
Restarting | ||
--restart-tries How many times a process that died should restart. | ||
[number] [default: 0] | ||
--restart-after Delay time to respawn the process, in milliseconds. | ||
[number] [default: 0] | ||
-t, --timestamp-format <format> specify the timestamp in moment/date-fns format. Default: YYYY-MM-DD HH:mm:ss.SSS | ||
Options: | ||
-h, --help Show help [boolean] | ||
-v, -V, --version Show version number [boolean] | ||
-r, --raw output only raw output of processes, disables prettifying and concurrently coloring | ||
-s, --success <first|last|all> Return exit code of zero or one based on the success or failure of the "first" child to terminate, the "last" child, or succeed only if "all" child processes succeed. Default: all | ||
-l, --prefix-length <length> limit how many characters of the command is displayed in prefix. | ||
The option can be used to shorten long commands. | ||
Works only if prefix is set to "command". Default: 10 | ||
--allow-restart Restart a process which died. Default: false | ||
--restart-after <miliseconds> delay time to respawn the process. Default: 0 | ||
--restart-tries <times> limit the number of respawn tries. Default: 1 | ||
--default-input-target <identifier> identifier for child process to which input on stdin should be sent if not specified at start of input. Can be either the index or the name of the process. Default: 0 | ||
Input: | ||
Input can be sent to any of the child processes using either the name or index | ||
of the command followed by a colon. If no child identifier is specified then the | ||
input will be sent to the child specified by the `--default-input-target` | ||
option, which defaults to index 0. | ||
Examples: | ||
- Kill other processes if one exits or dies | ||
$ concurrently --kill-others "grunt watch" "http-server" | ||
- Kill other processes if one exits with non zero status code | ||
$ concurrently --kill-others-on-fail "npm run build:client" "npm run build:server" | ||
- Output nothing more than stdout+stderr of child processes | ||
@@ -170,4 +193,5 @@ | ||
$ concurrently --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold" "http-server" "npm run watch" | ||
$ concurrently --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold" | ||
"http-server" "npm run watch" | ||
- Shortened NPM run commands | ||
@@ -179,13 +203,8 @@ | ||
$ concurrently "nodemon" "npm run watch-js" | ||
$ concurrently --handle-input "nodemon" "npm run watch-js" | ||
rs # Sends rs command to nodemon process | ||
- Specify a default-input-target | ||
$ concurrently --default-input-target 1 "npm run watch-js" nodemon | ||
rs | ||
- Send input to specific child identified by index | ||
$ concurrently "npm run watch-js" nodemon | ||
$ concurrently --handle-input "npm run watch-js" nodemon | ||
1:rs | ||
@@ -195,25 +214,5 @@ | ||
$ concurrently -n js,srv "npm run watch-js" nodemon | ||
$ concurrently --handle-input -n js,srv "npm run watch-js" nodemon | ||
srv:rs | ||
- Send input to default | ||
$ concurrently "nodemon" "npm run watch-js" | ||
rs # Sends rs command to nodemon process | ||
- Specify a default-input-target | ||
$ concurrently --default-input-target 1 "npm run watch-js" nodemon | ||
rs | ||
- Send input to specific child identified by index | ||
$ concurrently "npm run watch-js" nodemon | ||
1:rs | ||
- Send input to specific child identified by name | ||
$ concurrently -n js,srv "npm run watch-js" nodemon | ||
srv:rs | ||
- Shortened NPM run commands | ||
@@ -230,2 +229,48 @@ | ||
## Programmatic Usage | ||
concurrently can be used programmatically by using the API documented below: | ||
### `concurrently(commands[, options])` | ||
- `commands`: an array of either strings (containing the commands to run) or objects | ||
with the shape `{ command, name, prefixColor }`. | ||
- `options` (optional): an object containing any of the below: | ||
- `defaultInputTarget`: the default input target when reading from `inputStream`. | ||
Default: `0`. | ||
- `inputStream`: a [`Readable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_readable_streams) | ||
to read the input from, eg `process.stdin`. | ||
- `killOthers`: an array of exitting conditions that will cause a process to kill others. | ||
Can contain any of `success` or `failure`. | ||
- `outputStream`: a [`Writable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_writable_streams) | ||
to write logs to. Default: `process.stdout`. | ||
- `prefix`: the prefix type to use when logging processes output. | ||
Possible values: `index`, `pid`, `time`, `command`, `name`, `none`, or a template (eg `[{time} process: {pid}]`). | ||
Default: the name of the process, or its index if no name is set. | ||
- `prefixLength`: how many characters to show when prefixing with `command`. Default: `10` | ||
- `raw`: whether raw mode should be used, meaning strictly process output will | ||
be logged, without any prefixes, colouring or extra stuff. | ||
- `successCondition`: the condition to consider the run was successful. | ||
If `first`, only the first process will make up the success of the run; if `last`, the last. | ||
Anything else means all processes should exit successfully. | ||
- `restartTries`: how many attempts to restart a process that dies will be made. Default: `0`. | ||
- `restartDelay`: how many milliseconds to wait between process restarts. Default: `0`. | ||
- `timestampFormat`: a [date-fns/moment format](https://date-fns.org/v1.29.0/docs/format) | ||
to use when prefixing with `time`. Default: `YYYY-MM-DD HH:mm:ss.ZZZ` | ||
> Returns: a `Promise` that resolves if the run was successful (according to `successCondition` option), | ||
> or rejects otherwise. | ||
Example: | ||
```js | ||
const concurrently = require('concurrently'); | ||
concurrently([ | ||
'npm:watch-*', | ||
{ command: 'nodemon', name: 'server' } | ||
], { | ||
prefix: 'name', | ||
killOthers: ['failure', 'success'], | ||
restartTries: 3, | ||
}).then(success, failure); | ||
``` | ||
## FAQ | ||
@@ -246,12 +291,1 @@ | ||
## Why | ||
I like [task automation with npm](http://substack.net/task_automation_with_npm_run) | ||
but the usual way to run multiple commands concurrently is | ||
`npm run watch-js & npm run watch-css`. That's fine but it's hard to keep | ||
on track of different outputs. Also if one process fails, others still keep running | ||
and you won't even notice the difference. | ||
Another option would be to just run all commands in separate terminals. I got | ||
tired of opening terminals and made **concurrently**. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
578503
3
50
1843
285
1
1
+ Addedrxjs@6.2.2
+ Addedyargs@^12.0.1
+ Addedansi-regex@2.1.13.0.1(transitive)
+ Addedcamelcase@5.3.1(transitive)
+ Addedcliui@4.1.0(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcross-spawn@6.0.5(transitive)
+ Addeddecamelize@1.2.0(transitive)
+ Addedend-of-stream@1.4.4(transitive)
+ Addedexeca@1.0.0(transitive)
+ Addedfind-up@3.0.0(transitive)
+ Addedget-caller-file@1.0.3(transitive)
+ Addedget-stream@4.1.0(transitive)
+ Addedhas-flag@2.0.0(transitive)
+ Addedinvert-kv@2.0.0(transitive)
+ Addedis-fullwidth-code-point@1.0.02.0.0(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedlcid@2.0.0(transitive)
+ Addedlocate-path@3.0.0(transitive)
+ Addedmap-age-cleaner@0.1.3(transitive)
+ Addedmem@4.3.0(transitive)
+ Addedmimic-fn@2.1.0(transitive)
+ Addednice-try@1.0.5(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedos-locale@3.1.0(transitive)
+ Addedp-defer@1.0.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-is-promise@2.1.0(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpump@3.0.2(transitive)
+ Addedread-pkg@4.0.1(transitive)
+ Addedrequire-directory@2.1.1(transitive)
+ Addedrequire-main-filename@1.0.1(transitive)
+ Addedrxjs@6.2.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstring-width@1.0.22.1.1(transitive)
+ Addedstrip-ansi@3.0.14.0.0(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedsupports-color@4.5.0(transitive)
+ Addedtslib@1.14.1(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedwhich-module@2.0.1(transitive)
+ Addedwrap-ansi@2.1.0(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedy18n@4.0.3(transitive)
+ Addedyargs@12.0.5(transitive)
+ Addedyargs-parser@11.1.1(transitive)
- Removedcommander@2.6.0
- Removedrx@2.3.24
- Removedcommander@2.6.0(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedhas-flag@1.0.0(transitive)
- Removedload-json-file@4.0.0(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedread-pkg@3.0.0(transitive)
- Removedrx@2.3.24(transitive)
- Removedstrip-bom@3.0.0(transitive)
- Removedsupports-color@3.2.3(transitive)
Updatedlodash@^4.17.10
Updatedread-pkg@^4.0.1
Updatedsupports-color@^4.5.0