Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

concurrently

Package Overview
Dependencies
Maintainers
2
Versions
61
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concurrently - npm Package Compare versions

Comparing version 3.6.1 to 4.0.0

.vscode/settings.json

57

package.json
{
"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"
}
}

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc