{"_id":"addTimeout","_rev":"19-c368d5bcfe94f5e467ae7dbb99b7b63a","name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","dist-tags":{"latest":"0.4.0"},"versions":{"0.1.0":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first arguemnt for returning the Timeout Error","version":"0.1.0","keywords":["timeout","timeframe","callback"],"homepage":"http://homepage","repository":{"type":"git","url":"git repo"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{},"devDependencies":{"vows":">=0.5.8"},"_id":"addTimeout@0.1.0","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"4277c6f3945d97a8b09768c4fc40c29b9915bb3d","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.1.0.tgz","integrity":"sha512-VmeQK2uhqy/W9Ps/H86/2E+gmU3luTMQWyaYQe0bO1dnPsYhLRoYhSvgijLa0wsa16t3bjeB7vMEbnpW7deMWw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeYaqS/2a6u3mMCit7hFv4+5BaoMZs9FROv8x6eAnALAIhALlQjtzf7+CPa1fyFjmODY3qYNhPsdMbdAPM7FXP4t60"}]}},"0.1.1":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","version":"0.1.1","keywords":["timeout","timeframe","callback"],"homepage":"http://github.com/temsa/addTimeout","repository":{"type":"git","url":"git://github.com/temsa/addTimeout.git"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{},"devDependencies":{"vows":">=0.5.8"},"_id":"addTimeout@0.1.1","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"f3bbb5c0a574f11bf063db68c56b6685f2b5f20c","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.1.1.tgz","integrity":"sha512-laRHlkvQ6HfQNf02BQpSUArXEqRnASUJvyk4ECZE3fDIllHmO5b31INk1D5wHKU9yNjdFOpHDz3tgArwUTcF1Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCt78YhH6ZlQWYIAt3ZmfL0TFvtfMxHyPsDobJH72z7lwIgI/hn32bBtfRj9Iz0ZdtLn4QoF4z1OPGqlQwfr0bc19o="}]}},"0.1.2":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","version":"0.1.2","keywords":["timeout","timeframe","callback"],"homepage":"http://github.com/temsa/addTimeout","repository":{"type":"git","url":"git://github.com/temsa/addTimeout.git"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{},"devDependencies":{"vows":">=0.5.8"},"_id":"addTimeout@0.1.2","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"b280b6377993f42ee9adffa8107c39c37f397ad3","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.1.2.tgz","integrity":"sha512-oxD21Ik9wX5dA8IgOp7rThTDq7yI3IHmZuw5tPEE0Q/y26CO0RZi+uTiHUP0hy4vTl8mIGp8kHIX+qKdhmgFFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAfHxk9wgczsIjmQPCzR/WIB7f7Ita6bkoVvYq4C8W5rAiEAm2W2uFUo3/3DW5pZIAVRlCnFBP9/Qmgz0WdCbzwQLzw="}]}},"0.2.0":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","version":"0.2.0","keywords":["timeout","timeframe","callback"],"homepage":"http://github.com/temsa/addTimeout","repository":{"type":"git","url":"git://github.com/temsa/addTimeout.git"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{"err":">=0.6.0"},"devDependencies":{"vows":">=0.5.8"},"_id":"addTimeout@0.2.0","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"b3602584ca6acd811f6b1b2ac918d3a24549abdd","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.2.0.tgz","integrity":"sha512-cT0toeqC1wdNI7prWfezJOrrHVWa2+UBluT6/wIA233dfW8VO4MEOfBtIJ2JZBh4F02JIcHnB34SL57xxRl7RQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbgC6F8X2Xt1cQk9wUmRseQc7MAG9ZafhagSqMftN3cgIhAJXzjExaCw+Bk8fFULqWBchou3DQDkH+ROoDinKF8Hgq"}]}},"0.2.1":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","version":"0.2.1","keywords":["timeout","timeframe","callback"],"homepage":"http://github.com/temsa/addTimeout","repository":{"type":"git","url":"git://github.com/temsa/addTimeout.git"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{"err":">=0.6.0"},"devDependencies":{"vows":">=0.5.8"},"_id":"addTimeout@0.2.1","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"0d8bd7ea008c73eecb05b3dd1fbe1b791c2aae80","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.2.1.tgz","integrity":"sha512-HRofHfNDfR1vKGtfl7B+XVdZmHs3mzB9hCAD+0L5jIr1pcLX399+YloNW3934jafHAL6yv6bt95gHdvW1AeZBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1/rlJ8uaFZYqtA6wCBBciHA66swtO5VJXclsWMXcB9AiEArteVmNvOjdW8me4ycL8uvjCqkKaGbRP/WDr7UR8pK6U="}]}},"0.2.2":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","version":"0.2.2","keywords":["timeout","timeframe","callback"],"homepage":"http://github.com/temsa/addTimeout","repository":{"type":"git","url":"git://github.com/temsa/addTimeout.git"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{"err":">=0.6.0"},"devDependencies":{"vows":">=0.5.8"},"_id":"addTimeout@0.2.2","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"3318702f28eea835be323e16cfd6c2a71b343481","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.2.2.tgz","integrity":"sha512-L3w/UPHMd9hlJyE7JlG6EhghpD6jkb95cXbmEVzf51lerdbe2B5PGxPdKGY//2uP0iOIBiug6PFvbrKz++wvOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFiKnxcpNQ3MYOMYouUFHcatZMl5la1WpHGDM6apE0KrAiBll59Qagk+yhPh9yhsJsLcU/QAGSxyqIxqO+FVgXdNZg=="}]}},"0.2.3":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","version":"0.2.3","keywords":["timeout","timeframe","callback"],"homepage":"http://github.com/temsa/addTimeout","repository":{"type":"git","url":"git://github.com/temsa/addTimeout.git"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{},"devDependencies":{"vows":">=0.5.8"},"_id":"addTimeout@0.2.3","_engineSupported":true,"_npmVersion":"1.0.5","_nodeVersion":"v0.5.0-pre","_defaultsLoaded":true,"dist":{"shasum":"b690b390e2d777f4cd3710a1b38aea160a0ca86b","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.2.3.tgz","integrity":"sha512-zkuSzic/GkLEAOJYQ8L70psezMfppYMAMDX/xbuOaDv40L7MDZjiINSG6HD/jYpKPTSuioOBqmoMPJeD2FBdPw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCTWCn/XSffB39WuMOiKNxZLADzJbH/1cMaWS8ZudxT2gIgNDXLHv+Gmo1ziJcBd+UTNeJDAX1bQoQ9Ush7WJg5ZPQ="}]}},"0.4.0":{"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"name":"addTimeout","description":"Wraps a callback to handle a timeout. If the timeout occurs before the callback being called, it either uses the first argument for returning the TimeoutError (Node.JS style) or let it handle by a specialized handler","version":"0.4.0","keywords":["timeout","timeframe","callback"],"homepage":"http://github.com/temsa/addTimeout","repository":{"type":"git","url":"https://github.com/temsa/addTimeout.git"},"main":"index.js","scripts":{"test":"node test/test.js"},"engines":{"node":">=0.4.0"},"dependencies":{},"devDependencies":{"vows":">=0.5.8"},"readme":"[![build status](https://secure.travis-ci.org/temsa/addTimeout.png)](http://travis-ci.org/temsa/addTimeout)\n## Usage\n```javascript\nvar addTimeout = require(\"addTimeout\");\n\nvar callback = function(err){\n  if(err)\n    throw err;\n  console.log(\"hello, world : this has been fired before the timeout !\"\n};\n\n// here is some examples with setTimeout\nsetTimeout(addTimeout(500, callback), 100); //max timeout: 500ms, setTimeout will call the callback in 100ms -> result is OK !\nsetTimeout(addTimeout(500, callback), 1000); //max timeout: 500ms, setTimeout will call the callback in 1000ms -> too late : TimeoutError as the first callback argument!\n\n// with an error handler\nfunction errHandler(err) {\n  console.log(\"Timeout !\", err);\n}\nsetTimeout(addTimeout(500, callback, errHandler), 100); //max timeout: 500ms, setTimeout will call the callback in 100ms -> result is OK !\nsetTimeout(addTimeout(500, callback, errHandler), 1000); //max timeout: 500ms, setTimeout will call the callback in 1000ms -> too late : TimeoutError ! -> callback will not be called, but errHandler will, getting the Error as first argument\n```\n\n## Notes\n\nSupports negative timeout (always fail) as well a short time (<20ms) timeout. In those cases,\nthe callback will be called asap, but it's likely to be in ~20ms after addTimeout call\n\n## License\nMIT license\n","_id":"addTimeout@0.4.0","dist":{"shasum":"f3f99bbdedec159dd669fa4fa44f5a2eb0aef477","tarball":"https://registry.npmjs.org/addTimeout/-/addTimeout-0.4.0.tgz","integrity":"sha512-hWllqLOFzpnqsssf2RAKTlQkjQirX9FtDpUPYV23QZQn2UhWkvX14qpOh1ESMc6pe7Dulr6/xyd5DvXdYtsDFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGLED3L+/O5BmQS4l/2aSuIz1hZr3b8k/bSglY+k4maBAiB9lBwlbV259+ZRchpoP/CnwOXslzTMbBewr6K5ewzgAQ=="}]},"_npmVersion":"1.1.61","_npmUser":{"name":"temsa","email":"florian.traverse+npm@gmail.com"},"maintainers":[{"name":"temsa","email":"florian.traverse+npm@gmail.com"}]}},"maintainers":[{"name":"temsa","email":"florian.traverse+npm@gmail.com"}],"time":{"modified":"2022-06-13T02:25:38.758Z","created":"2011-07-21T11:54:57.795Z","0.1.0":"2011-07-21T11:54:58.330Z","0.1.1":"2011-07-21T14:14:42.509Z","0.1.2":"2011-07-21T14:28:45.589Z","0.2.0":"2011-07-25T11:17:52.456Z","0.2.1":"2011-07-25T13:36:20.565Z","0.2.2":"2011-07-25T14:48:21.747Z","0.2.3":"2011-07-25T18:09:44.185Z","0.4.0":"2012-09-18T17:12:23.150Z"},"author":{"name":"Florian Traverse","email":"florian.traverse@gmail.com","url":"http://pullrequest.org"},"repository":{"type":"git","url":"https://github.com/temsa/addTimeout.git"}}