Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs example concurrently() after v7.0.0 #303

Merged
merged 2 commits into from Jan 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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