gulp-plumber
    Overview
    Documentation
    Insights
    Code
    Contributors
    Dependencies
    Alternatives

gulp-plumber

Prevent pipe breaking caused by errors from gulp plugins

1.2.1  •  Published 1 years 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

Popularity

Weekly Downloads
235.7K
Stars
803

Maintenance

Development

Last ver 1 year ago
Created 6 years ago
Last commit 1 year ago
16 days between commits

Technology

Node version: 10.12.0
6.9K unpacked

Compliance

MIT License
OSI Approved
0 vulnerabilities

Contributors

12 contributors
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

Tags

gulpplugin
Ready for the next level?
Join Devstore's founding team to help us build the ultimate open-source app store, work with the latest technologies, and enjoy great culture, impact and autonomy
© 2019 Devstore, Inc.
Devstore helps developers find and use open-source packages, so they can focus on building amazing things