# gulp-plumber

> Prevent pipe breaking caused by errors from gulp plugins

Latest version **1.2.1** (published 2018-11-27) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2018-11-27 |
| First published | 2014-01-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/gulp-plumber) |
| Module format | CommonJS |
| Node | >=0.10 |
| Dependencies | 4 |
| Unpacked size | 6.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 796 |
| Author | Vsevolod Strukchinsky |
| Maintainers | floatdrop |
| Keywords | gulpplugin |

## Links

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

## Dependencies (4)

- [chalk](https://npm.io/package/chalk.md) ^1.1.3
- [through2](https://npm.io/package/through2.md) ^2.0.3
- [fancy-log](https://npm.io/package/fancy-log.md) ^1.3.2
- [plugin-error](https://npm.io/package/plugin-error.md) ^0.1.2

## Recent versions

- 1.2.1 (latest) — 2018-11-27
- 1.2.0 — 2018-01-06
- 1.1.0 — 2016-02-09
- 1.0.2 — 2016-02-09
- 1.0.1 — 2015-05-19
- 1.0.0 — 2015-03-09
- 0.6.6 — 2014-10-02
- 0.6.5 — 2014-08-25
- 0.6.4 — 2014-07-20
- 0.6.3 — 2014-06-12
- 0.6.2 — 2014-05-22
- 0.6.1 — 2014-04-12
- 0.6.0 — 2014-04-10
- 0.5.6 — 2014-01-11
- 0.5.5 — 2014-01-11
- … 14 more at https://npm.io/package/gulp-plumber/versions

## README

# :monkey: gulp-plumber
[![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]

> Prevent pipe breaking caused by errors from [gulp](https://github.com/wearefractal/gulp) plugins

This :monkey:-patch plugin is fixing [issue with Node Streams piping](https://github.com/gulpjs/gulp/issues/91). For explanations, read [this small article](https://gist.github.com/floatdrop/8269868).

Briefly it replaces `pipe` method and removes standard `onerror` handler on `error` event, which unpipes streams on error by default.

## Usage :monkey:

First, install `gulp-plumber` as a development dependency:

```shell
npm install --save-dev gulp-plumber
```

Then, add it to your `gulpfile.js`:

```javascript
var plumber = require('gulp-plumber');
var coffee = require('gulp-coffee');

gulp.src('./src/*.ext')
	.pipe(plumber())
	.pipe(coffee())
	.pipe(gulp.dest('./dist'));
```

## API :monkey:

### :monkey: plumber([options])

Returns Stream, that fixes `pipe` methods on Streams that are next in pipeline.

#### options
Type: `Object` / `Function`
Default: `{}`

Sets options described below from its properties. If type is `Function` it will be set as `errorHandler`.

#### options.inherit
Type: `Boolean`
Default: `true`

Monkeypatch `pipe` functions in underlying streams in pipeline.

#### options.errorHandler
Type: `Boolean` / `Function` <br/>
Default: `true`

Handle errors in underlying streams and output them to console.
 * `function` - it will be attached to stream `on('error')`.
 * `false` - error handler will not be attached.
 * `true` - default error handler will be attached.

### plumber.stop()

This method will return default behaviour for pipeline after it was piped.

```javascript
var plumber = require('gulp-plumber');

gulp.src('./src/*.scss')
    .pipe(plumber())
    .pipe(sass())
    .pipe(uglify())
    .pipe(plumber.stop())
    .pipe(gulp.dest('./dist'));
```

## License :monkey:

[MIT License](http://en.wikipedia.org/wiki/MIT_License)

[npm-url]: https://npmjs.org/package/gulp-plumber
[npm-image]: http://img.shields.io/npm/v/gulp-plumber.svg?style=flat

[travis-url]: https://travis-ci.org/floatdrop/gulp-plumber
[travis-image]: http://img.shields.io/travis/floatdrop/gulp-plumber.svg?style=flat

[depstat-url]: https://david-dm.org/floatdrop/gulp-plumber
[depstat-image]: http://img.shields.io/david/floatdrop/gulp-plumber.svg?style=flat

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