sensordb2 e64a8defe5 3.17 vor 1 Jahr
..
node_modules e64a8defe5 3.17 vor 1 Jahr
LICENSE e64a8defe5 3.17 vor 1 Jahr
README.md e64a8defe5 3.17 vor 1 Jahr
index.js e64a8defe5 3.17 vor 1 Jahr
package.json e64a8defe5 3.17 vor 1 Jahr

README.md

plugin-error NPM version Build Status

Error handling for vinyl plugins. Just an abstraction of what's in gulp-util with minor changes.

Install with npm

$ npm i plugin-error --save

Usage

var PluginError = require('plugin-error');

new PluginError(pluginName, message[, options]);

Params

  • pluginName should be the module name of your plugin
  • message {String|Object}: may be a string or an existing error object
  • options {Object}

Behavior:

  • By default the stack will not be shown. Set options.showStack to true if you think the stack is important for your error.
  • If you pass an error object as the message the stack will be pulled from that, otherwise one will be created.
  • If you pass in a custom stack string you need to include the message along with that.
  • Error properties will be included in err.toString(), but may be omitted by including {showProperties: false} in the options.

Examples

All of the following are acceptable forms of instantiation:

var err = new PluginError('test', {
  message: 'something broke'
});

var err = new PluginError({
  plugin: 'test',
  message: 'something broke'
});

var err = new PluginError('test', 'something broke');

var err = new PluginError('test', 'something broke', {showStack: true});

var existingError = new Error('OMG');
var err = new PluginError('test', existingError, {showStack: true});

Related projects

  • assemble: Static site generator for Grunt.js, Yeoman and Node.js. Used by Zurb Foundation, Zurb Ink, H5BP/Effeckt,… more
  • gulp-util: Utility functions for gulp plugins
  • gulp: The streaming build system
  • generate: Project generator, for node.js.
  • verb: Documentation generator for GitHub projects. Extremely powerful, easy to use, can generate anything from API… more

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on May 31, 2015.