# gulp-spawn

> spawn plugin for gulp

Latest version **2.0.0** (published 2022-12-22) · 0 weekly downloads

## Install

```sh
npm install gulp-spawn
pnpm add gulp-spawn
yarn add gulp-spawn
bun add gulp-spawn
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-12-22 |
| First published | 2013-12-03 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 2 |
| Unpacked size | 14.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Hector Parra |
| Maintainers | hgpa, pioug |
| Keywords | gulpplugin, spawn, cli, shell, exec |

## Links

- npm: https://www.npmjs.com/package/gulp-spawn
- Repository: https://github.com/pioug/gulp-spawn
- Issues: https://github.com/pioug/gulp-spawn/issues
- npm.io page: https://npm.io/package/gulp-spawn

## Dependencies (2)

- [plexer](https://npm.io/package/plexer.md) ^2.0.0
- [plugin-error](https://npm.io/package/plugin-error.md) ^2.0.1

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 2.0.0 (latest) — 2022-12-22
- 1.0.0 — 2021-01-17
- 0.4.5 — 2019-11-28
- 0.4.4 — 2018-10-10
- 0.4.3 — 2018-10-05
- 0.4.2 — 2018-10-05
- 0.4.1 — 2018-10-04
- 0.4.0 — 2017-04-07
- 0.3.0 — 2014-03-05
- 0.2.1 — 2013-12-03
- 0.2.0 — 2013-12-03

## README

# gulp-spawn

[![NPM version][npm-image]][npm-url] [![Build Status][actions-image]][actions-url] ![Dependency Status][depstat-image]

Plugin to spawn a CLI program for piping with
[gulp](https://github.com/wearefractal/gulp). Uses
[spawn](http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options).

## Usage

gulp-spawn options follow
[`child_process.spawn`](http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options)
conventions.

Not all CLI programs support piping. In fact, many newer ones don't. Some
programs require that you pass certain arguments if you intend to use stdin
and/or stdout. Please check the documentation of the program you intend to
use to ensure piping is supported.

The following example pipes image files to ImageMagick's `convert`. In the case
of `convert`, you must specify a `-` before arguments and after arguments if
you wish to use stdin and stdout, respectively.

```javascript
import spaw from "gulp-spawn";

// example using ImageMagick's convert
// setting "buffer: false" optional but recommended for heavy I/O
gulp
  .src("./src/images/*.{jpg,png,gif}", { buffer: false })
  .pipe(
    spawn({
      cmd: "convert",
      args: ["-", "-resize", "50%", "-"],
      // optional
      opts: { cwd: "." },
      filename: function (base, ext) {
        return base + "-half" + ext;
      },
    })
  )
  .pipe(gulp.dest("./dist/images/"));
```

## The UNIX Pipe Philosophy

If you write spawn programs please consider taking the time to support stdin &
stdout. Piping is one of the many reasons UNIX systems have endured the test
of time.

[npm-url]: https://npmjs.org/package/gulp-spawn
[npm-image]: https://badge.fury.io/js/gulp-spawn.svg
[depstat-image]: https://img.shields.io/librariesio/release/npm/gulp-spawn
[actions-url]: https://github.com/pioug/gulp-spawn/actions
[actions-image]: https://github.com/pioug/gulp-spawn/workflows/Run%20tests/badge.svg

---
_Source: https://npm.io/package/gulp-spawn · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
