Socket
Socket
Sign inDemoInstall

plugin-error

Package Overview
Dependencies
9
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    plugin-error

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


Version published
Maintainers
1
Install size
63.9 kB
Created

Readme

Source

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});
  • 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.

Keywords

FAQs

Last updated on 01 Jun 2015

Did you know?

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc