From 18b566ac7a4288eda87982ed0fd43e5444f0ce84 Mon Sep 17 00:00:00 2001 From: Camilla Krag Jensen Date: Wed, 12 Jan 2022 12:27:29 -0600 Subject: [PATCH 1/2] Update example in docs --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 71e1cbc7..154491f2 100644 --- a/README.md +++ b/README.md @@ -289,7 +289,7 @@ Example: ```js const concurrently = require('concurrently'); -concurrently([ +const { result } = concurrently([ 'npm:watch-*', { command: 'nodemon', name: 'server' }, { command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } }, @@ -299,7 +299,8 @@ concurrently([ killOthers: ['failure', 'success'], restartTries: 3, cwd: path.resolve(__dirname, 'scripts'), -}).then(success, failure); +}); +result.then(success, failure); ``` ### `Command` From cf31d827f243ed42307ecb56c06aac0e8bdb9d37 Mon Sep 17 00:00:00 2001 From: Camilla Krag Jensen Date: Wed, 12 Jan 2022 15:25:21 -0600 Subject: [PATCH 2/2] Change order for consistency with docs --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 154491f2..2a095775 100644 --- a/README.md +++ b/README.md @@ -280,7 +280,7 @@ concurrently can be used programmatically by using the API documented below: - `timestampFormat`: a [date-fns format](https://date-fns.org/v2.0.1/docs/format) to use when prefixing with `time`. Default: `yyyy-MM-dd HH:mm:ss.ZZZ` -> **Returns:** an object in the shape `{ commands, result }`. +> **Returns:** an object in the shape `{ result, commands }`. > - `result`: a `Promise` that resolves if the run was successful (according to `successCondition` option), > or rejects, containing an array of [`CloseEvent`](#CloseEvent), in the order that the commands terminated. > - `commands`: an array of all spawned [`Command`s](#Command).