Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
for these throwier times
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

throwify

for these throwier times... (or at least for versions of node that include domains)

build status

example

turn a node-style (exception ...rest) callback into a (...rest) callback that throws

var throwify = require('throwify');
var fs = require('fs');

var stat = throwify(fs.stat);

stat('some/file', function(stats) {
    //do something with stats object
});

why?

handling node-style error callbacks injects complexity into almost everything you'll write. often it's convenient and possible to wrap a discrete chunk of code in a domain and localize the exception handling there.

Something went wrong with that request. Please try again.