Skip to content

intentmedia/gulp-safety-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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