Skip to content

Commit 025db2f

Browse files
authored
docs: update example to reflect v7.x.x (#303)
1 parent 90c0da5 commit 025db2f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ concurrently can be used programmatically by using the API documented below:
280280
- `timestampFormat`: a [date-fns format](https://date-fns.org/v2.0.1/docs/format)
281281
to use when prefixing with `time`. Default: `yyyy-MM-dd HH:mm:ss.ZZZ`
282282

283-
> **Returns:** an object in the shape `{ commands, result }`.
283+
> **Returns:** an object in the shape `{ result, commands }`.
284284
> - `result`: a `Promise` that resolves if the run was successful (according to `successCondition` option),
285285
> or rejects, containing an array of [`CloseEvent`](#CloseEvent), in the order that the commands terminated.
286286
> - `commands`: an array of all spawned [`Command`s](#Command).
@@ -289,7 +289,7 @@ Example:
289289

290290
```js
291291
const concurrently = require('concurrently');
292-
concurrently([
292+
const { result } = concurrently([
293293
'npm:watch-*',
294294
{ command: 'nodemon', name: 'server' },
295295
{ command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } },
@@ -299,7 +299,8 @@ concurrently([
299299
killOthers: ['failure', 'success'],
300300
restartTries: 3,
301301
cwd: path.resolve(__dirname, 'scripts'),
302-
}).then(success, failure);
302+
});
303+
result.then(success, failure);
303304
```
304305

305306
### `Command`

0 commit comments

Comments
 (0)