Skip to content

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

Notifications You must be signed in to change notification settings

ben-bradley/throw-if

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages