gulp-plumber
    Overview
    Alternatives
    Playground
    Insights & Analysis
    Issues
    Versions
    Documentation
    Find an Expert
    Dependencies
    Career Opportunities
    Code

gulp-plumber

Prevent pipe breaking caused by errors from gulp plugins

1.2.1  •  Published 9 months ago  •  by Vsevolod Strukchinsky  •  MIT License

🐒 gulp-plumber

NPM version Build Status Dependency Status

Prevent pipe breaking caused by errors from gulp plugins

This 🐒-patch plugin is fixing issue with Node Streams piping. For explanations, read this small article.

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

Usage 🐒

First, install gulp-plumber as a development dependency:

npm install --save-dev gulp-plumber

Then, add it to your gulpfile.js:

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

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

API 🐒

🐒 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
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.

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

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

License 🐒

MIT License

Dependencies

chalk  ·  fancy-log  ·  plugin-error  ·  through2  ·  coveralls  ·  event-stream  ·  gulp  ·  istanbul  ·  mocha  ·  mocha-lcov-reporter  ·  should  ·  through  ·  xo

Tags

gulpplugin
Get a weekly digest of your favorite packages
We track new versions of your favorite packages, read the changelogs, and summarize them - so you dont have to
Just $5/month per user

Popularity

Weekly Downloads
235.7K
Stars
799

Issues and PRs

Activity

Last ver 9 months ago
Created 6 years ago
Last commit 9 months ago
16 days between commits

Sustainability

12 contributors

Technology

Node version: 10.12.0
6.9K unpacked

Legal and Compliance

MIT License
OSI Approved
0 vulnerabilities

Top Experts

Vsevolod Strukchinsky
Maintainer, 104 commits, 12 merges, 1 PRs
Works at Yandex
shinnn
2 commits, 1 PRs
Callum Locke
1 commits, 1 PRs
unknown
1 commits, 1 PRs
Works at WebMD Health Services
dgreif
1 commits, 1 PRs
Works at TelePharm
Sahat Yalkabov
1 commits, 1 PRs
Works at SIMON Markets LLC