Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

errc

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

errc

A different style of callbacks experiment

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

errc

npm install
Build Status Dependencies Status Known Vulnerabilities Downloads License

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) {
  // here data is either an instance of Error on failure
  // or a real data on success
});

Issues

For any bug reports or feature requests please post an issue on GitHub.

Author

Rafał Pocztarski
Follow on GitHub Follow on Twitter
Follow on Stack Exchange

License

MIT License (Expat). See LICENSE.md for details.

Keywords

FAQs

Package last updated on 09 Nov 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc