Skip to content

Commit

Permalink
Improve the execa.command() documentation (#317)
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky authored and sindresorhus committed Jun 25, 2019
1 parent 230c7a7 commit dd31d2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.d.ts
Expand Up @@ -407,6 +407,8 @@ declare const execa: {
If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.
The `shell` option must be used if the `command` uses shell-specific features, as opposed to being a simple `file` followed by its `arguments`.
@param command - The program/script to execute and its arguments.
@returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.
Expand Down
2 changes: 2 additions & 0 deletions readme.md
Expand Up @@ -178,6 +178,8 @@ Same as [`execa()`](#execafile-arguments-options) except both file and arguments

If the file or an argument contains spaces, they must be escaped with backslashes. This matters especially if `command` is not a constant but a variable, for example with `__dirname` or `process.cwd()`. Except for spaces, no escaping/quoting is needed.

The [`shell` option](#shell) must be used if the `command` uses shell-specific features, as opposed to being a simple `file` followed by its `arguments`.

### execa.commandSync(command, [options])

Same as [`execa.command()`](#execacommand-command-options) but synchronous.
Expand Down

0 comments on commit dd31d2c

Please sign in to comment.