Get unlimited public & private packages + team-based management with npm Teams.Learn more »

gulp-safety-net

1.0.1 • Public • Published

gulp-safety-net Build Status Dependencies

Exception safe javascript wrapper

Wraps files in a try/catch statement to not expose errors.

Install

$ npm install --save-dev gulp-safety-net

Usage

var gulp      = require('gulp'),
    safetyNet = require('gulp-safety-net');
 
gulp.task('default', function () {
    return gulp.src('src/app.js')
        .pipe(safetyNet())
        .pipe(gulp.dest('dist'));
});

API

safetyNet([options])

options.setup

Type: Function Default: function () {}

Allows a custom setup outside of the try/catch block.

setup : function() { window.Logger = new Logger(); }

options.logger

Type: String Default: 'console.log(e)'

Provides an alternative logging call to pass the error to.

logger: 'myCustomLogger(e)'

License

MIT

Install

npm i gulp-safety-net

DownloadsWeekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • avatar