gulp-plumber

Fixing Node pipes

Github星跟蹤圖

:monkey: gulp-plumber

NPM version Build Status Dependency Status

Prevent pipe breaking caused by errors from gulp plugins

This :monkey:-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 :monkey:

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 :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
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 :monkey:

MIT License

主要指標

概覽
名稱與所有者floatdrop/gulp-plumber
主編程語言JavaScript
編程語言JavaScript (語言數: 1)
平台
許可證MIT License
所有者活动
創建於2014-01-06 11:20:04
推送於2018-11-27 16:39:27
最后一次提交2018-11-27 21:39:06
發布數29
最新版本名稱v1.2.1 (發布於 2018-11-27 21:39:06)
第一版名稱v0.0.1 (發布於 2014-01-06 17:46:57)
用户参与
星數800
關注者數7
派生數28
提交數116
已啟用問題?
問題數52
打開的問題數17
拉請求數12
打開的拉請求數1
關閉的拉請求數0
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?