{"_id":"error-first-handler","_rev":"6-3de4517041cfce172cb1a9efe2cb907d","name":"error-first-handler","description":"handles error first callbacks","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"error-first-handler","description":"handles error first callbacks","version":"1.0.0","author":{"name":"Stephan Bönnemann","email":"stephan@boennemann.me"},"bugs":{"url":"https://github.com/boennemann/error-first-handler/issues"},"devDependencies":{"semantic-release":"^1.1.1","standard":"^2.3.1","tap-spec":"^2.2.0","tape":"^3.5.0"},"homepage":"https://github.com/boennemann/error-first-handler","keywords":["error","handling","callbacks","error-first"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"https://github.com/boennemann/error-first-handler.git"},"scripts":{"test":"standard && node tests | tap-spec","prepublish":"semantic-release pre","postpublish":"semantic-release post"},"gitHead":"77d83b5cc096bc991d52b1f4b31d5a1f39b03380","_id":"error-first-handler@1.0.0","_shasum":"7ff536b8815bee4993fe7ce141bb88fff21f0e4f","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"boennemann","email":"stephan@boennemann.me"},"maintainers":[{"name":"boennemann","email":"stephan@boennemann.me"}],"dist":{"shasum":"7ff536b8815bee4993fe7ce141bb88fff21f0e4f","tarball":"https://registry.npmjs.org/error-first-handler/-/error-first-handler-1.0.0.tgz","integrity":"sha512-2QC9dikUGDRBiNh9vaB+K99FT2JBfBX6Nr2YgXg9XS0CzaQT4MRz7pJjGJnjL4vzMWPqHOrD4DJ7K/t1WUXdpg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsF6B3Hxn4M59LGykftPfgA3Mklun9CyQeidr8un6sZgIhAN4Wz7BoiYKd5ymolhVkeDtLMWnrpVqkJRB7GRfx8yiY"}]}},"1.0.1":{"name":"error-first-handler","description":"handles error first callbacks","version":"1.0.1","author":{"name":"Stephan Bönnemann","email":"stephan@boennemann.me"},"bugs":{"url":"https://github.com/boennemann/error-first-handler/issues"},"devDependencies":{"semantic-release":"^1.1.1","standard":"^2.3.1","tap-spec":"^2.2.0","tape":"^3.5.0"},"homepage":"https://github.com/boennemann/error-first-handler","keywords":["error","handling","callbacks","error-first"],"license":"MIT","main":"index.js","repository":{"type":"git","url":"https://github.com/boennemann/error-first-handler.git"},"scripts":{"test":"standard && node tests | tap-spec","prepublish":"semantic-release pre","postpublish":"semantic-release post"},"gitHead":"665c2f1900f48dba7f2d7d89b2ba84764946cb32","_id":"error-first-handler@1.0.1","_shasum":"22c7a6135255a88fd9bdb491339aa5c16eded564","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"boennemann","email":"stephan@boennemann.me"},"maintainers":[{"name":"boennemann","email":"stephan@boennemann.me"}],"dist":{"shasum":"22c7a6135255a88fd9bdb491339aa5c16eded564","tarball":"https://registry.npmjs.org/error-first-handler/-/error-first-handler-1.0.1.tgz","integrity":"sha512-yensI0PlAvCRJk+LJ4yWV/7PB40xbdElE6CJr+8l3V2fjJ2JbPklziIp2d3cIkM/fHsu4XdXMGCe2jUhX+fsXg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCKeFcRQClLRRdR4BJ4oVdFyXMOI9dHSGVuoO4KDuFsmQIgMm1og5PlMRoxhlh+3LDEJrhSnIw3VtAPJ87mxUxTcX4="}]}}},"readme":"# error-first-handler\n[![Build Status](https://travis-ci.org/boennemann/error-first-handler.svg)](https://travis-ci.org/boennemann/error-first-handler)\n[![Dependency Status](https://david-dm.org/boennemann/error-first-handler.svg)](https://david-dm.org/boennemann/error-first-handler)\n[![devDependency Status](https://david-dm.org/boennemann/error-first-handler/dev-status.svg)](https://david-dm.org/boennemann/error-first-handler#info=devDependencies)\n\n[![NPM](https://nodei.co/npm/error-first-handler.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/error-first-handler/)\n\n> handles error first callbacks\n\n```bash\nnpm i -S error-first-handler\n```\n```js\nvar fs = require('fs')\nvar efh = require('error-first-handler')\n\nvar default = efh()\nfs.readFile('./package.json', default(function (data) {\n  // If an error occured it is thrown\n  // Otherwhise the error is shaved off the arguments array\n}))\n\nvar custom = efh(function (err) {\n  console.log(err)\n})\nfs.readFile('./package.json', custom(function (data) {\n  // If an error occured it is logged\n  // Otherwhise the error is shaved off the arguments array\n}))\n\nvar custom2 = efh(function (err) {\n  console.log(err)\n  return true\n})\nfs.readFile('./package.json', custom2(function (data) {\n  // If an error occured it is logged\n  // As the handler returns a truthy value the callback is executed\n}))\n\n// Passing errors to a parent callback is easy\nfunction readFile(cb) {\n  fs.readFile('./package.json', efh(cb)(function {\n    // If an error occured it is handled by the parent callback\n    // Otherwhise the error is shaved off the arguments array\n  }))  \n}\n```\n\nMIT License\n2015 Stephan Bönnemann\n","maintainers":[{"name":"boennemann","email":"stephan@boennemann.me"}],"time":{"modified":"2022-06-17T08:17:14.551Z","created":"2015-02-02T19:51:53.954Z","1.0.0":"2015-02-02T19:51:53.954Z","1.0.1":"2015-02-02T20:07:37.978Z"},"homepage":"https://github.com/boennemann/error-first-handler","keywords":["error","handling","callbacks","error-first"],"repository":{"type":"git","url":"https://github.com/boennemann/error-first-handler.git"},"author":{"name":"Stephan Bönnemann","email":"stephan@boennemann.me"},"bugs":{"url":"https://github.com/boennemann/error-first-handler/issues"},"license":"MIT","readmeFilename":"README.md"}