{"_id":"hurryup","_rev":"115180","name":"hurryup","description":"hurryUp.js ==========","dist-tags":{"latest":"0.0.8"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"time":{"modified":"2021-06-03T10:48:01.000Z","created":"2013-01-29T23:27:31.301Z","0.0.8":"2015-04-10T15:50:34.702Z","0.0.7":"2014-09-18T20:53:17.371Z","0.0.6":"2014-08-31T19:39:20.421Z","0.0.5":"2014-06-12T22:42:08.225Z","0.0.4":"2014-06-05T00:45:03.909Z","0.0.2":"2013-03-12T05:30:14.702Z","0.0.1":"2013-02-24T22:19:29.016Z","0.0.0":"2013-01-29T23:27:31.301Z"},"users":{},"author":"","repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"versions":{"0.0.8":{"name":"hurryup","version":"0.0.8","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"mocha --ui tdd --reporter dot"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"testling":{"files":["./node_modules/es5-shim/es5-shim.js","./node_modules/es5-shim/es5-sham.js","test/*-test.js"],"harness":"mocha-tdd","browsers":["ie/7..latest","firefox/3.5","firefox/latest","chrome/latest","safari/latest","opera/latest"]},"author":"","license":"BSD","dependencies":{"comerr":"0.0.x"},"devDependencies":{"expect.js":"0.2.x","mocha":"1.8.x","es5-shim":"3.4.0","testling":"1.7.0"},"gitHead":"12d480438f67ec89bfd2ba71730629c0ab1d5c8a","bugs":{"url":"https://github.com/crcn/hurryUp.js/issues"},"homepage":"https://github.com/crcn/hurryUp.js","_id":"hurryup@0.0.8","_shasum":"fcd742f33fcebd24fc3ca93a445027e8a6642f5b","_from":".","_npmVersion":"2.5.0","_nodeVersion":"0.10.4","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"dist":{"shasum":"fcd742f33fcebd24fc3ca93a445027e8a6642f5b","size":2825,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.8.tgz"},"directories":{},"publish_time":1428681034702,"_cnpm_publish_time":1428681034702,"_hasShrinkwrap":false},"0.0.7":{"name":"hurryup","version":"0.0.7","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"mocha --ui tdd --reporter dot"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"testling":{"files":["./node_modules/es5-shim/es5-shim.js","./node_modules/es5-shim/es5-sham.js","test/*-test.js"],"harness":"mocha-tdd","browsers":["ie/7..latest","firefox/3.5","firefox/latest","chrome/latest","safari/latest","opera/latest"]},"author":"","license":"BSD","dependencies":{"comerr":"0.0.x"},"devDependencies":{"expect.js":"0.2.x","mocha":"1.8.x","es5-shim":"3.4.0","testling":"1.7.0"},"gitHead":"f0d993dbd3d711f4d41d78ce827a285d183c1148","bugs":{"url":"https://github.com/crcn/hurryUp.js/issues"},"homepage":"https://github.com/crcn/hurryUp.js","_id":"hurryup@0.0.7","_shasum":"99af0d5fbdbbb352d9c6e361a1f9a1b1cf12870d","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"dist":{"shasum":"99af0d5fbdbbb352d9c6e361a1f9a1b1cf12870d","size":2552,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.7.tgz"},"directories":{},"publish_time":1411073597371,"_cnpm_publish_time":1411073597371,"_hasShrinkwrap":false},"0.0.6":{"name":"hurryup","version":"0.0.6","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"mocha --ui tdd --reporter dot"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"testling":{"files":["./node_modules/es5-shim/es5-shim.js","./node_modules/es5-shim/es5-sham.js","test/*-test.js"],"harness":"mocha-tdd","browsers":["ie/7..latest","firefox/3.5","firefox/latest","chrome/latest","safari/latest","opera/latest"]},"author":"","license":"BSD","dependencies":{"comerr":"0.0.x"},"devDependencies":{"expect.js":"0.2.x","mocha":"1.8.x","es5-shim":"3.4.0","testling":"1.7.0"},"gitHead":"d83b92478f8d59cf0cfaa437630ce344e996a987","bugs":{"url":"https://github.com/crcn/hurryUp.js/issues"},"homepage":"https://github.com/crcn/hurryUp.js","_id":"hurryup@0.0.6","_shasum":"878fa49661dad043de72d67235a85e6c6b500284","_from":".","_npmVersion":"1.4.24","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"dist":{"shasum":"878fa49661dad043de72d67235a85e6c6b500284","size":2559,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.6.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.6.tgz"},"directories":{},"publish_time":1409513960421,"_cnpm_publish_time":1409513960421,"_hasShrinkwrap":false},"0.0.5":{"name":"hurryup","version":"0.0.5","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"mocha --reporter min"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"author":"","license":"BSD","dependencies":{"comerr":"0.0.x"},"devDependencies":{"expect.js":"0.2.x","mocha":"1.8.x"},"bugs":{"url":"https://github.com/crcn/hurryUp.js/issues"},"homepage":"https://github.com/crcn/hurryUp.js","_id":"hurryup@0.0.5","dist":{"shasum":"12bef6ef0774df7f324b807764571b360393871b","size":2399,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.5.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"directories":{},"publish_time":1402612928225,"_cnpm_publish_time":1402612928225,"_hasShrinkwrap":false},"0.0.4":{"name":"hurryup","version":"0.0.4","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"mocha --reporter min"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"author":"","license":"BSD","dependencies":{"comerr":"0.0.x"},"devDependencies":{"expect.js":"0.2.x","mocha":"1.8.x"},"bugs":{"url":"https://github.com/crcn/hurryUp.js/issues"},"homepage":"https://github.com/crcn/hurryUp.js","_id":"hurryup@0.0.4","dist":{"shasum":"f33e9402e0a7986803d93f42170c945813026d19","size":2229,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.4.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"directories":{},"publish_time":1401929103909,"_cnpm_publish_time":1401929103909,"_hasShrinkwrap":false},"0.0.2":{"name":"hurryup","version":"0.0.2","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"mocha --reporter min"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"author":"","license":"BSD","readmeFilename":"README.md","dependencies":{"comerr":"0.0.x"},"devDependencies":{"expect.js":"0.2.x","mocha":"1.8.x"},"_id":"hurryup@0.0.2","dist":{"shasum":"2862cdc01152f5dcca743f37735d300bd6efa41c","size":2131,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.2.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"directories":{},"publish_time":1363066214702,"_cnpm_publish_time":1363066214702,"_hasShrinkwrap":false},"0.0.1":{"name":"hurryup","version":"0.0.1","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"author":"","license":"BSD","readmeFilename":"README.md","dependencies":{"comerr":"0.0.x"},"_id":"hurryup@0.0.1","dist":{"shasum":"f920a58e02352036ecb029f9eb6a5db7ccd0e360","size":1699,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.1.tgz"},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"directories":{},"publish_time":1361744369016,"_cnpm_publish_time":1361744369016,"_hasShrinkwrap":false},"0.0.0":{"name":"hurryup","version":"0.0.0","description":"hurryUp.js ==========","main":"./lib/index.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/crcn/hurryUp.js.git"},"author":"","license":"BSD","readmeFilename":"README.md","dependencies":{"comerr":"0.0.x"},"_id":"hurryup@0.0.0","dist":{"shasum":"b67f0eecf660b7bb6044eeb5fc39adea86f29581","size":1249,"noattachment":false,"key":"/hurryup/-/hurryup-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hurryup/download/hurryup-0.0.0.tgz"},"_npmVersion":"1.1.66","_npmUser":{"name":"architectd","email":"craig.j.condon@gmail.com"},"maintainers":[{"name":"architectd","email":"craig.j.condon@gmail.com"},{"name":"crcn","email":"craig.j.condon@gmail.com"}],"directories":{},"publish_time":1359502051301,"_cnpm_publish_time":1359502051301,"_hasShrinkwrap":false}},"readme":"[![Build Status](https://travis-ci.org/crcn/hurryUp.js.svg)](https://travis-ci.org/crcn/hurryUp.js)\n\nHurryUp is a timeout library for asynchronous, fault-prone function calls. Basically, it'll timeout an async call if it's been running for too long. You can also specify to re-call async functions until they succeed (see below).\n\nWhat can you use it for?\n\n- db operations\n- api calls\n- async jobs\n\n\n#### hurryUp(asyncCallback, optionsOrTimeout, ...args)\n\n- `asyncCallback` - async function to call\n- `optionsOrTimeout` \n  - `object` - options passed\n    - `retry` - TRUE if the timedCallback should be re-called if it returns an error\n    - `retryTimeout` - timeout between retrying timed callback\n    - `timeout` - kill timeout\n  - `number` - the timeout before killing the function call\n- `...args` - additional arguments to pass to the async callback\n\n```javascript\nhurryUp(function(next) {\n  \n  //this will cause an error\n  setTimeout(next, 2000);\n}, 1000).call(null, function(err, result) {\n  console.error(\"timeout has occurred!\")\n})\n```\n\nHere's an easier way to wrap around a method:\n\n```javascript\nhurryUp(emitter.once, 1000).call(emitter, \"connected\", function(err, result) {\n  \n});\n```\n\nYou can also use hurryup to run a callback multiple times until it succeeds, like so:\n\n```javascript\n\nfunction isItReady(next) {\n  //async stuff here\n  next(new Error(\"no!\"));\n}\n\nhurryUp(function(next) {\n  isItReady(next);\n}, { retry: true }).call(null, function(err) {\n  console.log(err.message); //no!\n});\n```\n","_attachments":{},"homepage":"https://github.com/crcn/hurryUp.js","bugs":{"url":"https://github.com/crcn/hurryUp.js/issues"},"license":"BSD"}