throw-if

0.0.1 • Public • Published

throw-if Build Status

A small module to prevent re-writing the same error handling code again and again.

Example

Before ("old 'n busted")

foo((err) => {
  if (err)
    throw new Error(err);
 
  // ...
});

After ("new hottness")

import throwIf from 'throw-if';
 
foo((err) => {
  throwIf(err);
 
  // ...
});

Install

npm install --save throw-if

Versions

  • 0.0.1 - Initial commit

Readme

Keywords

none

Package Sidebar

Install

npm i throw-if

Weekly Downloads

0

Version

0.0.1

License

MIT

Last publish

Collaborators

  • ben-bradley