Skip to content

Commit

Permalink
docs: update example to reflect v7.x.x (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
naxoc committed Jan 12, 2022
1 parent 90c0da5 commit 025db2f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -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).
Expand All @@ -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: '...' } },
Expand All @@ -299,7 +299,8 @@ concurrently([
killOthers: ['failure', 'success'],
restartTries: 3,
cwd: path.resolve(__dirname, 'scripts'),
}).then(success, failure);
});
result.then(success, failure);
```

### `Command`
Expand Down

0 comments on commit 025db2f

Please sign in to comment.