Socket
Book a DemoInstallSign in
Socket

pipe-error-stop

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pipe-error-stop

Buffers a pipe until it ends. Only passes data onward if no error was emitted.

0.0.11
latest
Source
npmnpm
Version published
Weekly downloads
35
1066.67%
Maintainers
1
Weekly downloads
 
Created
Source

Pipe-Error-Stop

Buffers a pipe until it ends. If the pipe emits an error, will not flush data onward. Otherwise, flushes all data at once.

Issues should be reported on the issue tracker.

Note: The usage changed between 0.0.9 and 0.0.11! The new usage is much more intuitive in my opinion, the code is cleaned up, and the tests are much better.

Installation

npm install --save pipe-error-stop

Usage

In this example, if the gulp-jade plugin throws an error on any .jade file, then gulp will not write any output, and the gulp process will end successfully. This has the added benefit of keeping gulp.watch from breaking.

var pipeErrorStop = require('pipe-error-stop'),
  gulp = require('gulp'),
  jade = require('gulp-jade');

gulp.task('jade', function() {
  return gulp
    .src('src/**/*.jade')
    .pipe(jade())
    .pipe(pipeErrorStop())
    .pipe(gulp.dest('dest'));
});

API

pipeErrorStop(options)

options

errorCallback

Type: function(err)

If supplied, this callback is executed when an error is encountered. For example, you may want to call require('gulp-notify').onError to display a growl error notification.

successCallback

Type: function(err)

If supplied, this callback is executed when no error is encountered and the previous stream ends. It is called only when data is flushed through the pipe.

License

MIT.

Keywords

pipe

FAQs

Package last updated on 16 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.