errc
![License](https://img.shields.io/npm/l/errc.svg)
A different style of callbacks experiment written for an answer on Stack Overflow:
It allows you to register callbacks to standard Node functions that expect error-fist callback style, but use a different convention inside of your callback - the first argument to your callback will either be an instance of Error
on failure (with its message
field set to the original error) or the first non-error argument on success.
For code examples see
node-errc-example
on GitHub.
Installation
Install to use in your Node project, updating the dependencies in package.json:
npm install errc --save
Usage
var errc = require('errc');
var fs = require('fs');
fs.readFile('example2.txt', errc(function (data) {
});
Issues
For any bug reports or feature requests
please post an issue on GitHub.
Author
Rafał Pocztarski
![Follow on Stack Exchange](https://stackexchange.com/users/flair/303952.png)
License
MIT License (Expat). See LICENSE.md for details.