Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed May 19, 2019
1 parent 3d064d4 commit 7a36d85
Showing 1 changed file with 31 additions and 9 deletions.
40 changes: 31 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ Command execution in Gulp.js.
As opposed to other plugins or
[`child_process.exec()`](https://nodejs.org/api/child_process.html#child_process_child_process_exec_command_options_callback),
`gulp-execa` uses the popular [`execa`](https://github.com/sindresorhus/execa)
library:
library providing:

- [Better Windows support](https://github.com/IndigoUnited/node-cross-spawn#why),
including [shebangs](<https://en.wikipedia.org/wiki/Shebang_(Unix)>).
- Faster and more secure, as it does not use a shell (by default).
- Execution of locally installed binaries.
- Descriptive errors and configurable verbosity.
- Interleaved stdout/stderr.
including [shebangs](<https://en.wikipedia.org/wiki/Shebang_(Unix)>)
- Faster and more secure commands, since no shell is used by default
- Execution of locally installed binaries
- Descriptive errors and configurable verbosity
- Interleaved `stdout`/`stderr`

Commands can be executed either directly or inside a files stream. In streaming
mode, unlike similar libraries:

- commands are run [in parallel](https://github.com/almost/through2-concurrent),
not [serially](https://github.com/rvagg/through2).
- output can be saved either in files or in variables.
not [serially](https://github.com/rvagg/through2)
- output can be saved either in files or in variables

Example gulpfile:

Expand Down Expand Up @@ -68,5 +68,27 @@ Executes `command` and returns a promise.
## stream(function, [options])

Returns a stream that executes a `command` on each input file. `function` must
take the [file](https://gulpjs.com/docs/en/api/vinyl#instance-properties) as
take a [file](https://gulpjs.com/docs/en/api/vinyl#instance-properties) as
argument and return a `command`.

# Command

By default, no shell interpreter (like Bash or `cmd.exe`) is used. This means
`command` must only be the program path followed by arguments. No
escaping/quoting is needed, except for significant spaces (with a backslash).

Shell features such as globbing, variables and operators (`&&`, `>`, `;`) should
not be used. Fortunately, all of this can done directly in Node.js instead.

Shell interpreters are slower, less secure and less cross-platform. However, you
can still use them by specifying the `shell` option.

```js
const { series } = require('gulp')

// Wrong
module.exports.check = task('npm audit && npm outdated')

// Correct
module.exports.check = series(task('npm audit'), task('npm outdated'))
```

0 comments on commit 7a36d85

Please sign in to comment.