Skip to content

Commit c31bb87

Browse files
committed
Improve killOthers docs
Closes #535
1 parent 11500d4 commit c31bb87

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ Check out documentation and other usage examples in the [`docs` directory](./doc
9696
- `inputStream`: a [`Readable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_readable_streams)
9797
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`.
9898
- `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)).
99-
- `killOthers`: an array of exitting conditions that will cause a process to kill others.
100-
Can contain any of `success` or `failure`.
99+
- `killOthersOn`: once the first command exits with one of these statuses, kill other commands.
100+
Can be an array containing the strings `success` (status code zero) and/or `failure` (non-zero exit status).
101101
- `maxProcesses`: how many processes should run at once.
102102
- `outputStream`: a [`Writable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_writable_streams)
103103
to write logs to. Default: `process.stdout`.

bin/concurrently.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const program = yargs(hideBin(process.argv))
112112
// Kill others
113113
'kill-others': {
114114
alias: 'k',
115-
describe: 'Kill other processes if one exits or dies.',
115+
describe: 'Kill other processes once the first exits.',
116116
type: 'boolean',
117117
},
118118
'kill-others-on-fail': {
@@ -232,7 +232,7 @@ concurrently(
232232
{
233233
handleInput: args.handleInput,
234234
defaultInputTarget: args.defaultInputTarget,
235-
killOthers: args.killOthers
235+
killOthersOn: args.killOthers
236236
? ['success', 'failure']
237237
: args.killOthersOnFail
238238
? ['failure']

src/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,15 @@ export type ConcurrentlyOptions = Omit<BaseConcurrentlyOptions, 'abortSignal' |
7878

7979
// Process killing options
8080
/**
81-
* Under which condition(s) should other commands be killed when the first one exits.
82-
*
81+
* @deprecated Use `killOthersOn` instead.
8382
* @see KillOthers
8483
*/
8584
killOthers?: ProcessCloseCondition | ProcessCloseCondition[];
85+
/**
86+
* Once the first command exits with one of these statuses, kill other commands.
87+
* @see KillOthers
88+
*/
89+
killOthersOn?: ProcessCloseCondition | ProcessCloseCondition[];
8690

8791
// Timing options
8892
/**
@@ -160,7 +164,7 @@ export function concurrently(
160164
}),
161165
new KillOthers({
162166
logger,
163-
conditions: options.killOthers || [],
167+
conditions: options.killOthersOn || options.killOthers || [],
164168
killSignal: options.killSignal,
165169
abortController,
166170
}),

0 commit comments

Comments
 (0)