Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: open-cli-tools/concurrently
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 943219cd4ebbd9773fe5c883cd56a4893a0d1973
Choose a base ref
...
head repository: open-cli-tools/concurrently
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 105445c08494474e90d32e215401fd921b75b471
Choose a head ref

Commits on Sep 7, 2020

  1. build(deps): bump yargs-parser from 13.1.1 to 13.1.2 (#243)

    Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2.
    - [Release notes](https://github.com/yargs/yargs-parser/releases)
    - [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md)
    - [Commits](https://github.com/yargs/yargs-parser/commits)
    
    Signed-off-by: dependabot[bot] <support@github.com>
    
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Sep 7, 2020
    Copy the full SHA
    7f1bd27 View commit details

Commits on Sep 21, 2020

  1. Copy the full SHA
    81aa338 View commit details
  2. Copy the full SHA
    7700363 View commit details
  3. Copy the full SHA
    b62a2a1 View commit details

Commits on Jan 7, 2021

  1. Copy the full SHA
    e17f693 View commit details
  2. Copy the full SHA
    2e1ad01 View commit details

Commits on Feb 20, 2021

  1. Support for hex colors in prefixColor (#261)

    Closes #260
    Ramakrishna authored Feb 20, 2021
    Copy the full SHA
    6fcbf19 View commit details
  2. Add cwd option to programmatic API (#246)

    Closes #216
    thdk authored Feb 20, 2021
    Copy the full SHA
    986bc3d View commit details
  3. 6.0.0

    gustavohenke committed Feb 20, 2021
    Copy the full SHA
    343d1ab View commit details

Commits on Apr 5, 2021

  1. Copy the full SHA
    9fa0544 View commit details
  2. 6.0.1

    gustavohenke committed Apr 5, 2021
    Copy the full SHA
    e36e8c1 View commit details

Commits on Apr 12, 2021

  1. Copy the full SHA
    7710c21 View commit details
  2. Fix input handler when input contains a colon (#269)

    Patrick Sachs authored Apr 12, 2021
    Copy the full SHA
    330cf92 View commit details
  3. 6.0.2

    gustavohenke committed Apr 12, 2021
    Copy the full SHA
    ccb6b8d View commit details

Commits on May 6, 2021

  1. Run npm audit fix

    gustavohenke committed May 6, 2021
    Copy the full SHA
    70b92da View commit details

Commits on May 8, 2021

  1. Copy the full SHA
    ecf1c5b View commit details
  2. 6.1.0

    gustavohenke committed May 8, 2021
    Copy the full SHA
    aad79fa View commit details

Commits on May 9, 2021

  1. Copy the full SHA
    e8f0706 View commit details
  2. Copy the full SHA
    d38ab32 View commit details

Commits on May 24, 2021

  1. 6.2.0

    gustavohenke committed May 24, 2021
    Copy the full SHA
    becac73 View commit details

Commits on May 27, 2021

  1. Correctly reexport flow controllers

    Fixes #278
    gustavohenke authored May 27, 2021
    Copy the full SHA
    10ff00c View commit details

Commits on Jul 28, 2021

  1. Add GH actions workflow

    aivenkimmob committed Jul 28, 2021
    Copy the full SHA
    fe5c01c View commit details

Commits on Jul 29, 2021

  1. Copy the full SHA
    f574848 View commit details

Commits on Aug 3, 2021

  1. Copy the full SHA
    07a7de1 View commit details

Commits on Aug 8, 2021

  1. Copy the full SHA
    c295062 View commit details
  2. 6.2.1

    gustavohenke committed Aug 8, 2021
    Copy the full SHA
    0bc490f View commit details

Commits on Sep 25, 2021

  1. Copy the full SHA
    b16585f View commit details
  2. Copy the full SHA
    24e51ad View commit details
  3. Copy the full SHA
    8bcdf7f View commit details

Commits on Sep 27, 2021

  1. Remove read-pkg

    Fixes #274
    gustavohenke committed Sep 27, 2021
    Copy the full SHA
    7263ffe View commit details
  2. Fix linting

    gustavohenke committed Sep 27, 2021
    Copy the full SHA
    875d375 View commit details
  3. 6.2.2

    gustavohenke committed Sep 27, 2021
    Copy the full SHA
    105445c View commit details
8 changes: 6 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
"node": true
},
"parserOptions": {
"ecmaVersion": 6
"ecmaVersion": 8
},
"rules": {
"block-spacing": "error",
@@ -18,6 +18,10 @@
"quotes": ["error", "single"],
"semi": "error",
"space-before-blocks": "error",
"space-before-function-paren": ["error", "never"]
"space-before-function-paren": ["error", {
"anonymous": "never",
"named": "never",
"asyncArrow": "always"
}]
}
}
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Tests
on: [push, pull_request]
env:
CI: true

jobs:
run:
name: Node ${{ matrix.node }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
node: [12, 14, 15]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Clone repository
uses: actions/checkout@v1

- name: Set Node.js version
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}

- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm ci

- name: Run tests
run: npm test
shell: bash
env:
SHELL: "/bin/bash"

- name: Lint
run: npm run lint

- name: Submit coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
flag-name: Node.js ${{ matrix.node }}
parallel: true
teardown:
needs: run
name: Submitting coverage
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
parallel-finished: true
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

6 changes: 2 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -13,11 +13,9 @@ updated.
Tests can be run with command:

```bash
npm run test
npm test
```

## Release

* Commit all changes
* Run `./node_modules/.bin/releasor --bump minor`, which will create new tag and publish code to GitHub and npm. See https://github.com/kimmobrunfeldt/releasor for options
* Edit GitHub release notes
Use [np](https://www.npmjs.com/package/np) to create a new release
49 changes: 31 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Concurrently

[![Travis Build Status](https://travis-ci.org/kimmobrunfeldt/concurrently.svg)](https://travis-ci.org/kimmobrunfeldt/concurrently) [![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/kimmobrunfeldt/concurrently?branch=master&svg=true)](https://ci.appveyor.com/project/kimmobrunfeldt/concurrently) *master branch status*
[![Build Status](https://github.com/open-cli-tools/concurrently/workflows/Tests/badge.svg)](https://github.com/open-cli-tools/concurrently/actions?workflow=Tests)
[![Coverage Status](https://coveralls.io/repos/github/open-cli-tools/concurrently/badge.svg?branch=master)](https://coveralls.io/github/open-cli-tools/concurrently?branch=master)

[![NPM Badge](https://nodei.co/npm/concurrently.png?downloads=true)](https://www.npmjs.com/package/concurrently)

@@ -10,15 +11,17 @@ Like `npm run watch-js & npm run watch-less` but better.
![](docs/demo.gif)

**Table of contents**
- [Why](#why)
- [Install](#install)
- [Usage](#usage)
- [Programmatic Usage](#programmatic-usage)
- [FAQ](#faq)
- [Concurrently](#concurrently)
- [Why](#why)
- [Install](#install)
- [Usage](#usage)
- [Programmatic Usage](#programmatic-usage)
- [`concurrently(commands[, options])`](#concurrentlycommands-options)
- [FAQ](#faq)

## Why

I like [task automation with npm](http://substack.net/task_automation_with_npm_run)
I like [task automation with npm](https://github.com/substack/blog/blob/master/npm_run.markdown)
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
@@ -140,11 +143,12 @@ Prefix styling
- Available modifiers: reset, bold, dim, italic,
underline, inverse, hidden, strikethrough
- Available colors: black, red, green, yellow, blue,
magenta, cyan, white, gray
magenta, cyan, white, gray, or any hex values for
colors, eg #23de43
- 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"]
information. [string] [default: "reset"]
-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"
@@ -166,9 +170,10 @@ Killing other processes
code [boolean]
Restarting
--restart-tries How many times a process that died should restart.
--restart-tries How many times a process that died should restart.
Negative numbers will make the process restart forever.
[number] [default: 0]
--restart-after Delay time to respawn the process, in milliseconds.
--restart-after Delay time to respawn the process, in milliseconds.
[number] [default: 0]
Options:
@@ -217,20 +222,26 @@ Examples:
$ concurrently npm:watch-*
For more details, visit https://github.com/kimmobrunfeldt/concurrently
For more details, visit https://github.com/open-cli-tools/concurrently
```

## 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, env }`.
with the shape `{ command, name, prefixColor, env, cwd }`.

- `options` (optional): an object containing any of the below:
- `cwd`: the working directory to be used by all commands. Can be overriden per command.
Default: `process.cwd()`.
- `defaultInputTarget`: the default input target when reading from `inputStream`.
Default: `0`.
- `handleInput`: when `true`, reads input from `process.stdin`.
- `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`.
to read the input from. Should only be used in the rare instance you would like to stream anything other than `process.stdin`. Overrides `handleInput`.
- `pauseInputStreamOnFinish`: by default, pauses the input stream (`process.stdin` when `handleInput` is enabled, or `inputStream` if provided) when all of the processes have finished. If you need to read from the input stream after `concurrently` has finished, set this to `false`. ([#252](https://github.com/kimmobrunfeldt/concurrently/issues/252)).
- `killOthers`: an array of exitting conditions that will cause a process to kill others.
Can contain any of `success` or `failure`.
- `maxProcesses`: how many processes should run at once.
@@ -252,9 +263,9 @@ concurrently can be used programmatically by using the API documented below:

> Returns: a `Promise` that resolves if the run was successful (according to `successCondition` option),
> or rejects, containing an array of objects with information for each command that has been run, in the order
> that the commands terminated. The objects have the shape `{ command, index, exitCode }`, where `command` is the object
> passed in the `commands` array and `index` its index there. Default values (empty strings or objects) are returned for
> the fields that were not specified.
> that the commands terminated. The objects have the shape `{ command, index, exitCode, killed }`, where `command` is the object
> passed in the `commands` array, `index` its index there and `killed` indicates if the process was killed as a result of
> `killOthers`. Default values (empty strings or objects) are returned for the fields that were not specified.
Example:

@@ -263,11 +274,13 @@ const concurrently = require('concurrently');
concurrently([
'npm:watch-*',
{ command: 'nodemon', name: 'server' },
{ command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } }
{ command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } },
{ command: 'watch', name: 'watch', cwd: path.resolve(__dirname, 'scripts/watchers')}
], {
prefix: 'name',
killOthers: ['failure', 'success'],
restartTries: 3,
cwd: path.resolve(__dirname, 'scripts'),
}).then(success, failure);
```

20 changes: 0 additions & 20 deletions appveyor.yml

This file was deleted.

9 changes: 6 additions & 3 deletions bin/concurrently.js
Original file line number Diff line number Diff line change
@@ -83,7 +83,8 @@ const args = yargs
'Comma-separated list of chalk colors to use on prefixes. ' +
'If there are more commands than colors, the last color will be repeated.\n' +
'- Available modifiers: reset, bold, dim, italic, underline, inverse, hidden, strikethrough\n' +
'- Available colors: black, red, green, yellow, blue, magenta, cyan, white, gray\n' +
'- Available colors: black, red, green, yellow, blue, magenta, cyan, white, gray \n' +
'or any hex values for colors, eg #23de43\n' +
'- Available background colors: bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite\n' +
'See https://www.npmjs.com/package/chalk for more information.',
default: defaults.prefixColors,
@@ -106,7 +107,9 @@ const args = yargs

// Restarting
'restart-tries': {
describe: 'How many times a process that died should restart.',
describe:
'How many times a process that died should restart.\n' +
'Negative numbers will make the process restart forever.',
default: defaults.restartTries,
type: 'number'
},
@@ -154,7 +157,7 @@ concurrently(args._.map((command, index) => {
name: names[index]
};
}), {
inputStream: args.handleInput && process.stdin,
handleInput: args.handleInput,
defaultInputTarget: args.defaultInputTarget,
killOthers: args.killOthers
? ['success', 'failure']
8 changes: 4 additions & 4 deletions bin/concurrently.spec.js
Original file line number Diff line number Diff line change
@@ -193,7 +193,7 @@ describe('--names', () => {
});

describe('--prefix', () => {
it('is alised to -p', done => {
it('is aliased to -p', done => {
const child = run('-p command "echo foo" "echo bar"');
child.log.pipe(buffer(child.close)).subscribe(lines => {
expect(lines).toContainEqual(expect.stringContaining('[echo foo] foo'));
@@ -213,7 +213,7 @@ describe('--prefix', () => {
});

describe('--prefix-length', () => {
it('is alised to -l', done => {
it('is aliased to -l', done => {
const child = run('-p command -l 5 "echo foo" "echo bar"');
child.log.pipe(buffer(child.close)).subscribe(lines => {
expect(lines).toContainEqual(expect.stringContaining('[ec..o] foo'));
@@ -247,7 +247,7 @@ describe('--restart-tries', () => {
});

describe('--kill-others', () => {
it('is alised to -k', done => {
it('is aliased to -k', done => {
const child = run('-k "sleep 10" "exit 0"');
child.log.pipe(buffer(child.close)).subscribe(lines => {
expect(lines).toContainEqual(expect.stringContaining('[1] exit 0 exited with code 0'));
@@ -300,7 +300,7 @@ describe('--kill-others-on-fail', () => {
});

describe('--handle-input', () => {
it('is alised to -i', done => {
it('is aliased to -i', done => {
const child = run('-i "node fixtures/read-echo.js"');
child.log.subscribe(line => {
if (/READING/.test(line)) {
2 changes: 1 addition & 1 deletion bin/epilogue.txt
Original file line number Diff line number Diff line change
@@ -39,4 +39,4 @@ Examples:

$ $0 npm:watch-*

For more details, visit https://github.com/kimmobrunfeldt/concurrently
For more details, visit https://github.com/open-cli-tools/concurrently
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ const RestartProcess = require('./src/flow-control/restart-process');
const concurrently = require('./src/concurrently');
const Logger = require('./src/logger');

module.exports = (commands, options = {}) => {
module.exports = exports = (commands, options = {}) => {
const logger = new Logger({
outputStream: options.outputStream || process.stdout,
prefixFormat: options.prefix,
@@ -22,14 +22,16 @@ module.exports = (commands, options = {}) => {
maxProcesses: options.maxProcesses,
raw: options.raw,
successCondition: options.successCondition,
cwd: options.cwd,
controllers: [
new LogError({ logger }),
new LogOutput({ logger }),
new LogExit({ logger }),
new InputHandler({
logger,
defaultInputTarget: options.defaultInputTarget,
inputStream: options.inputStream,
inputStream: options.inputStream || (options.handleInput && process.stdin),
pauseInputStreamOnFinish: options.pauseInputStreamOnFinish,
}),
new KillOnSignal({ process }),
new RestartProcess({
Loading