@@ -280,7 +280,7 @@ concurrently can be used programmatically by using the API documented below:
280
280
- ` timestampFormat ` : a [ date-fns format] ( https://date-fns.org/v2.0.1/docs/format )
281
281
to use when prefixing with ` time ` . Default: ` yyyy-MM-dd HH:mm:ss.ZZZ `
282
282
283
- > ** Returns:** an object in the shape ` { commands, result } ` .
283
+ > ** Returns:** an object in the shape ` { result, commands } ` .
284
284
> - ` result ` : a ` Promise ` that resolves if the run was successful (according to ` successCondition ` option),
285
285
> or rejects, containing an array of [ ` CloseEvent ` ] ( #CloseEvent ) , in the order that the commands terminated.
286
286
> - ` commands ` : an array of all spawned [ ` Command ` s] ( #Command ) .
@@ -289,7 +289,7 @@ Example:
289
289
290
290
``` js
291
291
const concurrently = require (' concurrently' );
292
- concurrently ([
292
+ const { result } = concurrently ([
293
293
' npm:watch-*' ,
294
294
{ command: ' nodemon' , name: ' server' },
295
295
{ command: ' deploy' , name: ' deploy' , env: { PUBLIC_KEY : ' ...' } },
@@ -299,7 +299,8 @@ concurrently([
299
299
killOthers: [' failure' , ' success' ],
300
300
restartTries: 3 ,
301
301
cwd: path .resolve (__dirname , ' scripts' ),
302
- }).then (success, failure);
302
+ });
303
+ result .then (success, failure);
303
304
```
304
305
305
306
### ` Command `
0 commit comments