{"_id":"step-error","_rev":"40-6dc44d8ab95caefad4ed9ec29ac7702f","name":"step-error","description":"Plugin for Creationix's flow control library (step) for global error handling","dist-tags":{"latest":"0.7.0"},"versions":{"0.1.0":{"name":"step-error","version":"0.1.0","description":"Just like Creationix's flow control library (step), except with global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","_id":"step-error@0.1.0","dist":{"shasum":"1a1c665766d6211a8c9eafe87f226a88ef7ef093","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.1.0.tgz","integrity":"sha512-kotuxbLar83BZRMn3epYqEvhbjVpshfHzC5LFT1OKIcsa0PU+jpEAQhZvav+PMLHMwSAHeSJXHWt2AcO/bK2iQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAcXGEb7hVqdowtTSkuy0/NmXUfMpXJrdITCLxVd16e+AiEAhfrvMN8ipujw7H+7Ve/WoWX02kGbRuDXnpJZuDu+mSI="}]},"_npmVersion":"1.1.65","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.1.1":{"name":"step-error","version":"0.1.1","description":"Just like Creationix's flow control library (step), except with global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","_id":"step-error@0.1.1","dist":{"shasum":"caffa99659296f032cb4241478a554fca4fb8afa","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.1.1.tgz","integrity":"sha512-kCETrzJsPeoGXi3ubhvv8zXpDN7Vl24YcOVTquzy3yynwqHlGRVGm5VIl1yGyuKvL4Fg97lHLW6LFjNYFPBkxw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcY2tI3yUERWdzCZV+DALgg5NyzhmXQ9I97yPNZViMhAIgSDI7Z8LjHEowDKzYdvNQvgIZw7EYGaXX3IKges4DPT4="}]},"_npmVersion":"1.1.71","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.2.0":{"name":"step-error","version":"0.2.0","description":"Just like Creationix's flow control library (step), except with global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":"*"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","_id":"step-error@0.2.0","dist":{"shasum":"2c81479a4133d8b22f146ff27f54745d2fd4e3d5","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.2.0.tgz","integrity":"sha512-sBruX/la0AaztBz9Xx7nOpzBW1C4EZs5xgvH7z2JHOhEZO15j7n3wKG8SmVxBSs60Di+Dsyx+MJBjx5ZhZgWwQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDtV9Ja3hAVwFoq1E4+zQfmxAFsjFPZ+eWFDlNEDKQYqQIgZA6ms0tdaNDe2TMrhnOvvmBzml0T2jT82PsXp0283zw="}]},"_npmVersion":"1.1.71","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.2.1":{"name":"step-error","version":"0.2.1","description":"Just like Creationix's flow control library (step), except with global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":"*"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","_id":"step-error@0.2.1","dist":{"shasum":"e90ac293767a72671fbec9927dab471bc837f283","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.2.1.tgz","integrity":"sha512-LX7ze4kZhL/gcc7Gfcrkmjon9LK8fm1NMd9HGA+TR0zVUW4RKEQV2iGWPrms6hUnTiNVW9kRkLo8TOTwG5uoVw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5s0Zzbag6RbC9eUsP774YLmvgFXgyvOVVSemW0Poe8AIgbvmoS0Vxa6lYhaqdDJFttiGm7Zla7aDYe+gg5nVe/bQ="}]},"_npmVersion":"1.1.71","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.3.0":{"name":"step-error","version":"0.3.0","description":"Just like Creationix's flow control library (step), except with global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":"*"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","_id":"step-error@0.3.0","dist":{"shasum":"f9167305590847e1b06e8302cf49f1e10ae1aea0","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.3.0.tgz","integrity":"sha512-/TVofqsPKXXQLMGeVDjGi8dVH1Y6xDGONW4ZBOjLQ4gbAa98Cyrc1rempq5v2rVIaVjphQYeh0j4525LrRbpvQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0mYmMNXpbPHciGxHQ6XDsibCcyhsojS9Qw/3b5fWxZwIgRO4NUq/nf4gBH0OuhfHbWzAKLxPC+RLokACBxM9NlMU="}]},"_npmVersion":"1.1.71","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.4.0":{"name":"step-error","version":"0.4.0","description":"Just like Creationix's flow control library (step), except with global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":"*"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","_id":"step-error@0.4.0","dist":{"shasum":"ebac2a12f4df9d043c7b7c5edda9ef4f6fdf0c8a","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.4.0.tgz","integrity":"sha512-ZSOXbJgVNOkWt4i76HGMys5H8Pah8ZjPd/KbCIbhthIv3JruvONPbuTb954ui/7ikCIzC+HL8tj+wnMbw/WqeA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbxZuE+Kpi++qbXyMSSs6hWr51QtpIphXxy2cfGE/55QIgDmqw/TSi1zVrPjdSI0cSgetEtO5/Tnyen3QdgeZZlhY="}]},"_from":".","_npmVersion":"1.2.12","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.5.0":{"name":"step-error","version":"0.5.0","description":"Plugin for Creationix's flow control library (step) for global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"peerDependencies":{"step":"<2"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","bugs":{"url":"https://github.com/bminer/step-error/issues"},"_id":"step-error@0.5.0","dist":{"shasum":"c829da3bdfdd89b4ac0ee2e48182a189ea5ad2d3","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.5.0.tgz","integrity":"sha512-ClLQR0K8aqcyafT2Hi45l6VIdByDaIrCFCrc/TsZ0E1wd9VWryPuesm9kOg05Me9+XKYoEAkjU0fKcJ0Sl1k2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDw3K/xrU/hzHEODbQH8lQnheQMA54NQ+P1v2VUeIuEKwIhAMoUGvU/UdV4NSzWOUiF0JKd93JTUOqJjbQKDPbNo+Uo"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.6.0":{"name":"step-error","version":"0.6.0","description":"Plugin for Creationix's flow control library (step) for global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":">=0.0.5 <2"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","bugs":{"url":"https://github.com/bminer/step-error/issues"},"_id":"step-error@0.6.0","dist":{"shasum":"38f4addb723f11b546a4e85569322fdb46d8f595","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.6.0.tgz","integrity":"sha512-ikNfTG+vAWkaJIHJBKmR/r4D5PalsgSpZlgndGM1EaDwQMPndNR7D8LjuCf8k6PVUDPLXtvFlmdrk+Yp3xyVMw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDG4dYKLpPL7QtVV9ua5VmXdAUnononRDeUh7eKammvmwIgUaCaEmzDErxLzDhH9XEiRl5ziO/4M1KUd/XHZeqMWMI="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.6.1":{"name":"step-error","version":"0.6.1","description":"Plugin for Creationix's flow control library (step) for global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":">=0.0.5 <2"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","bugs":{"url":"https://github.com/bminer/step-error/issues"},"_id":"step-error@0.6.1","dist":{"shasum":"293231c9b226d07cb7ce35b953560ede1c62b19b","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.6.1.tgz","integrity":"sha512-JwpWYcArWn331ODH+sH5YAmxn+P5Q6Vd2dPkC12hpF/45MHKDRIvP6be63RONGGm3n0EixRqAFx8I1iTFNxusA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCsW4OtsBATZz7t/kd5tnoIb6y9JMxePlO8gBOSxD2dVwIhAOTVHwylfc5ec6NKK/ygRpax1xBUJDHjAtALfQMlLnvK"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.6.2":{"name":"step-error","version":"0.6.2","description":"Plugin for Creationix's flow control library (step) for global error handling","main":"index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":">=0.0.5 <2"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","bugs":{"url":"https://github.com/bminer/step-error/issues"},"_id":"step-error@0.6.2","dist":{"shasum":"22bf5c4f13ac442387ccba20d79ee4ab9f301e15","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.6.2.tgz","integrity":"sha512-9Np+oqZWj/XGZhhI3MbQgBWn1r6qqoSrgQ4EsMNRom/9qGH+fvNgr458BUZUOlVgV/z7QaqqMg4W48Vo2oW2rQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEoOpqwwgZSeOjKm0J0sMpjElVUMMUqbVZSuvyhRa/0IAiAbuYsu/zAbAEZ0QRRu+GbpiblrZ8kp0QFmdDhhRT8KiA=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"directories":{},"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"},"0.7.0":{"name":"step-error","version":"0.7.0","description":"Plugin for Creationix's flow control library (step) for global error handling","main":"index.js","scripts":{"test":"nodeunit ./test"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"dependencies":{"step":">=0.0.5 <2"},"devDependencies":{"nodeunit":">=0.8"},"keywords":["flow","control","step","error"],"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"license":"MIT","bugs":{"url":"https://github.com/bminer/step-error/issues"},"_id":"step-error@0.7.0","dist":{"shasum":"b3d428a356ae5a63947895c2d74cd4fc112005b5","tarball":"https://registry.npmjs.org/step-error/-/step-error-0.7.0.tgz","integrity":"sha512-yejIvtVg2713BieqkVaff22IfOzi4toAHjR9vzkDqEfLBu3pq6+Yx6TxP2bmGJOvBHH0kAlpzI7FlKm9FIArqg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDfCN4VvYJiUpy0AqqDX23kuKYxlwc3EtRg3LXhBfQJOAiAJddqzes7Aq7pmcvMwKHGq9Gpk+ufYO6efTmnCtxL3Dg=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"bminer","email":"miner.blake@gmail.com"},"maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"deprecated":"Please use 'stride' package instead. https://github.com/bminer/stride"}},"readme":"step-error\r\n==========\r\n\r\nPlugin for [Creationix's flow control library (step)](https://github.com/creationix/step) for global error handling.\r\n\r\n## About\r\n\r\nUse Step as you normally would, except callbacks don't get an `err` Object.  To\r\nhandle errors, add event handlers or `_catch()` or `_finally()` functions.\r\n\r\nYou may add more than one `_catch()` function, but only one `_finally()` function.\r\nIn addition, you may provide a `_catchAll()` function, which will be called for each\r\nerror, not just for the first one.\r\n\r\nThis error handling technique was inspired by [node-block](https://github.com/tasogarepg/node-block).\r\n\r\nThe caveat is that all functions need to expect the first argument to be the Error\r\nObject, or `null` if there is no error.\r\n\r\n## Install\r\n\r\nJust install step-error.  Step is installed as a dependency.\r\n\r\n`npm install step-error`\r\n\r\n## API\r\n\r\n`StepError(func1, func2, ...)`\r\n\r\nwhere `func1` and `func2` are functions that you would normally pass to `Step(...)`.\r\n\r\nIf an error occurs in `func1`, for example, `func2` will not be executed (unless\r\n`func2` has any of the special function names described below).\r\n\r\n#### Special Function Names\r\n\r\nIf the name of any function is `_catch`, it will ONLY be called on the first error.\r\nIf the name of any function is `_catchAll`, it will ONLY be called on each error.\r\nIf the name of any function is `_finally`, it will ONLY be called after everything is\r\ndone, even if an error occurs.\r\n\r\n#### Event Handlers\r\n\r\n`StepError` also returns an `EventEmitter` Object which will emit `error` events.\r\nIf no function named `_finally` is passed to `StepError`, then the `EventEmitter`\r\nwill also emit a single `done` event.\r\n\r\nThis method is generally preferred over using special function names.\r\n\r\n## Example\r\n\r\nInstead of...\r\n\r\n```js\r\nvar Step = require(\"step\");\r\nStep(\r\n  function readDir() {\r\n    fs.readdir(__dirname, this);\r\n  },\r\n  function readFiles(err, results) {\r\n    if (err) throw err;\r\n    // Create a new group\r\n    var group = this.group();\r\n    results.forEach(function (filename) {\r\n      if (/\\.js$/.test(filename)) {\r\n        fs.readFile(__dirname + \"/\" + filename, 'utf8', group());\r\n      }\r\n    });\r\n  },\r\n  function showAll(err , files) {\r\n    if (err) throw err;\r\n    console.dir(files);\r\n  }\r\n);\r\n```\r\n\r\nwrite this...\r\n\r\n```js\r\nvar StepError = require(\"step-error\");\r\nStepError(\r\n  function readDir() {\r\n    fs.readdir(__dirname, this);\r\n  },\r\n  function readFiles(results) {\r\n    // Create a new group\r\n    var group = this.group();\r\n    results.forEach(function (filename) {\r\n      if (/\\.js$/.test(filename)) {\r\n        fs.readFile(__dirname + \"/\" + filename, 'utf8', group());\r\n      }\r\n    });\r\n  },\r\n  function showAll(files) {\r\n    console.dir(files);\r\n    this(); //Should be a `this()` call in the final function, as well\r\n  }\r\n).on(\"error\", function(err) {\r\n  console.dir(err);\r\n});\r\n```\r\n\r\n... or instead of using `on(\"error\")`, just pass a function named `_catch` to\r\n`StepError`.\r\n","maintainers":[{"name":"bminer","email":"miner.blake@gmail.com"}],"time":{"modified":"2022-06-27T00:20:44.109Z","created":"2012-11-14T19:46:26.216Z","0.1.0":"2012-11-14T19:46:26.849Z","0.1.1":"2013-01-24T22:31:03.263Z","0.1.2":"2013-01-25T22:44:15.900Z","0.1.3":"2013-01-25T22:52:10.810Z","0.2.0":"2013-01-25T22:53:35.099Z","0.2.1":"2013-01-25T23:44:21.468Z","0.3.0":"2013-01-26T00:22:39.922Z","0.4.0":"2013-03-04T17:32:27.246Z","0.5.0":"2013-11-06T17:28:34.457Z","0.6.0":"2013-11-07T14:39:45.831Z","0.6.1":"2013-11-07T15:13:45.621Z","0.6.2":"2013-11-22T02:05:53.738Z","0.7.0":"2013-12-16T15:53:27.155Z"},"author":{"name":"Blake Miner","email":"miner.blake@gmail.com","url":"http://www.blakeminer.com/"},"repository":{"type":"git","url":"git://github.com/bminer/step-error.git"},"keywords":["flow","control","step","error"],"bugs":{"url":"https://github.com/bminer/step-error/issues"},"license":"MIT","readmeFilename":"README.md"}