{"_id":"retimer","_rev":"12-3b43d35a54b685e91e5e5e0d494417c0","name":"retimer","description":"Reschedulable Timer for your node needs","dist-tags":{"latest":"4.0.0"},"versions":{"0.0.1":{"name":"retimer","version":"0.0.1","description":"Reschedulable Timer for your node needs","main":"retimer.js","scripts":{"test":"tape test.js | faucet"},"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"keywords":["schedulable","reschedulable","timer","setTimeout"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/retimer/issues"},"homepage":"https://github.com/mcollina/retimer#readme","gitHead":"8269f0eec6f485408953a7125ad1b7aa821d6e6f","_id":"retimer@0.0.1","_shasum":"8d0494e5b85f1ed9ccfcbbd80f8d26c8180c1b93","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.1","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"dist":{"shasum":"8d0494e5b85f1ed9ccfcbbd80f8d26c8180c1b93","tarball":"https://registry.npmjs.org/retimer/-/retimer-0.0.1.tgz","integrity":"sha512-jpRPtoViRgSC3lig50ngOtVVnwmUKTz2N5HXbF8dWfVyZ7p3i9q8KRzUX4m+Z7nowK8TYnphQUwnMfbKBMia6Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGItnsAaKXFPNdJsN6mLkikfeycekVx/FVzy8NBRK/1kAiEA2qsH4yPTCP9dMiybUb7MvM0j7ufi7yYp0OigFqIpHiQ="}]},"directories":{}},"1.0.0":{"name":"retimer","version":"1.0.0","description":"Reschedulable Timer for your node needs","main":"retimer.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"keywords":["schedulable","reschedulable","timer","setTimeout"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/retimer/issues"},"homepage":"https://github.com/mcollina/retimer#readme","devDependencies":{"fastbench":"^1.0.0","faucet":"0.0.1","pre-commit":"^1.0.10","standard":"^4.5.2","tape":"^4.0.0"},"gitHead":"a2db92736bc0a352e4d9378a12de857159738ee4","_id":"retimer@1.0.0","_shasum":"2a7c6e59619452e44e60267e4ba2564148758694","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.1","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"dist":{"shasum":"2a7c6e59619452e44e60267e4ba2564148758694","tarball":"https://registry.npmjs.org/retimer/-/retimer-1.0.0.tgz","integrity":"sha512-mACS7IAnrKM8RWG2le2xSUUxK5EDuxli5JNlvyD9UgkniAz1TubvR3VtCyfRxqyX7uPc93fmGxpsUVIGA8N6eg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA6jugJEyg83CJtCg1PIsEURkZgbm4iOsM7Zm3fLtbWLAiEA6KfV1J5+wiytMxS50od3y3XJ16HGeOckbujGz97IIEE="}]},"directories":{}},"1.0.1":{"name":"retimer","version":"1.0.1","description":"Reschedulable Timer for your node needs","main":"retimer.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"keywords":["schedulable","reschedulable","timer","setTimeout"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/retimer/issues"},"homepage":"https://github.com/mcollina/retimer#readme","devDependencies":{"fastbench":"^1.0.0","faucet":"0.0.1","pre-commit":"^1.0.10","standard":"^4.5.2","tape":"^4.0.0"},"gitHead":"00b33fd90b7cbb4f928f9747b5ef6d0a9d4a84e3","_id":"retimer@1.0.1","_shasum":"e6d0040e2ce2f9cc22cfab211e78ade5120c85e9","_from":".","_npmVersion":"2.11.3","_nodeVersion":"2.3.1","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"dist":{"shasum":"e6d0040e2ce2f9cc22cfab211e78ade5120c85e9","tarball":"https://registry.npmjs.org/retimer/-/retimer-1.0.1.tgz","integrity":"sha512-wcjculEJbAij9GD3gW57Gc8osm2eKkkrIshIDPerXmEtA1uOmGuQEXSY9+DRB6pIcqFX5tZSK8+M4x6nn8Ad8Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCIpeGfdO/M3I7IwPvJCHvQIerYkkUZsC6oollHIgWGGAIgA56QmnWqmGOD51LnFuplqXX9hPwmd601xKqzGeBy6rA="}]},"directories":{}},"1.1.0":{"name":"retimer","version":"1.1.0","description":"Reschedulable Timer for your node needs","main":"retimer.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"keywords":["schedulable","reschedulable","timer","setTimeout"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/retimer/issues"},"homepage":"https://github.com/mcollina/retimer#readme","devDependencies":{"fastbench":"^1.0.0","faucet":"0.0.1","pre-commit":"^1.0.10","standard":"^10.0.0","tape":"^4.0.0"},"gitHead":"31ea94f195780b7b65ec573aff8dd104062e02e1","_id":"retimer@1.1.0","_npmVersion":"5.4.2","_nodeVersion":"8.6.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"integrity":"sha512-+Tjoa47XqpO+cmNObvmK6UPFmUTzQPtr4MqMS7ZJKPKYAnryCxG2FXT8/SEgPsEghQQgXFPZEdILNxJkvXtjUw==","shasum":"8cb2cec5cc200c245622e943aa11549f25c5ed2c","tarball":"https://registry.npmjs.org/retimer/-/retimer-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDwT0mY8C9RGOFdnWcXqLzvhAkr4za7UqhmXnI6a2e0UAIgdeB70GOyQhhV28nBAq8jKesLgZxWxYk9ac5O0W+Y4Jw="}]},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/retimer-1.1.0.tgz_1507536978354_0.09810336516238749"},"directories":{}},"2.0.0":{"name":"retimer","version":"2.0.0","description":"Reschedulable Timer for your node needs","main":"retimer.js","scripts":{"lint":"standard","test":"tape test.js | faucet"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"keywords":["schedulable","reschedulable","timer","setTimeout"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/retimer/issues"},"homepage":"https://github.com/mcollina/retimer#readme","devDependencies":{"fastbench":"^1.0.0","faucet":"0.0.1","pre-commit":"^1.0.10","standard":"^12.0.0","tape":"^4.0.0"},"browser":{"./time.js":"./time-browser.js"},"gitHead":"7b90aa31e740745e10a6a90bf09b738b56f42594","_id":"retimer@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"11.3.0","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"integrity":"sha512-KLXY85WkEq2V2bKex/LOO1ViXVn2KGYe4PYysAdYdjmraYIUsVkXu8O4am+8+5UbaaGl1qho4aqAAPHNQ4GSbg==","shasum":"e8bd68c5e5a8ec2f49ccb5c636db84c04063bbca","tarball":"https://registry.npmjs.org/retimer/-/retimer-2.0.0.tgz","fileCount":9,"unpackedSize":7898,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcEqSDCRA9TVsSAnZWagAAVd8P/jDqkMp28KRwiZxy9wNf\nsv93evY8f9fnBb+xytWfXlWQEiZTB9EaS2gDw7LYs32m/xDzLj9fM/68pQjA\nDJIOftc/twtnkCROIaGCWqUXjpjpJOtY5xGfpa3wklF8pcpmLFkHgjL/4FC0\nZCaaIL/3JLDc1oE3msHIDjAiQSY1PgvMEmWNXpylmPIawhY4qSJDJUthpbrQ\nsGCW1RNAEZBBuu5m6S5ekKjrmXtNUem/llS1hbhdORrZ48Xy5La27yOwZtQD\nlaE5Q2CQmdBz9Ra9u43U2ZxpZ71ch5BnSSjPJWOhFKhUzYNup5EkOUvnQVDR\nm0k+rfLT3xsEWzmroZP3uygYzVoXB9dYJPMT0lgvZgVPDDpRYuswPJu+mgcH\neAufIBN+03WqH0NmvK1dgC+29Na4MK/rHiiLtbTBpBGLnSVCEWA7Ucjr7Ok8\n3GlhL0d42Lg/arq20wOYWwDMM7grMJya0a8bRq0/RlZi86sfq/X+VMAq9by1\nceB5H7BJTbbjqrmQuK8cejCNAcPWpCCh3xxhNG3M73UqbaU2SHZocQjRAGjf\nzxGoMn3zU3dQT1NoQXFHb/GE4Golp/7JXQQBBPqxDP+PvIxKox86N4sUCog0\nVLGhhYAuouuBX46l50oadkZ69uZModP+vjhSxAI6TbFN0NcGPQpHWVheEzBx\nERqk\r\n=GxaG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQChZtcJ438jPsbfqxRpme/B9Y/NyPDGnt/B82qdO75RHAIgHxZxTAac8i1tDukr8oQO9rK3vA1FZLUkYaFXox4dLBs="}]},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/retimer_2.0.0_1544725634755_0.8922109887785181"},"_hasShrinkwrap":false},"3.0.0":{"name":"retimer","version":"3.0.0","description":"Reschedulable Timer for your node needs","main":"retimer.js","scripts":{"lint":"standard","test":"tape test.js | tap-dot"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"keywords":["schedulable","reschedulable","timer","setTimeout"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/retimer/issues"},"homepage":"https://github.com/mcollina/retimer#readme","devDependencies":{"fastbench":"^1.0.0","pre-commit":"^1.0.10","standard":"^16.0.0","tap-dot":"^2.0.0","tape":"^5.0.0"},"browser":{"./time.js":"./time-browser.js"},"gitHead":"fd4dc9721bfca72754fbc7c5e0f2f2d630edfa72","_id":"retimer@3.0.0","_nodeVersion":"14.15.4","_npmVersion":"6.14.11","_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"dist":{"integrity":"sha512-WKE0j11Pa0ZJI5YIk0nflGI7SQsfl2ljihVy7ogh7DeQSeYAUi0ubZ/yEueGtDfUPk6GH5LRw1hBdLq4IwUBWA==","shasum":"98b751b1feaf1af13eb0228f8ea68b8f9da530df","tarball":"https://registry.npmjs.org/retimer/-/retimer-3.0.0.tgz","fileCount":9,"unpackedSize":8877,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPhxTCRA9TVsSAnZWagAAXIcP/AoNE1JgTN74w1a393yC\nJMgIMZe9ZBFq409wWYMsS3H21eKSp0NKCwNNzOWcdSUnAKbvE8I8wGZfFoVB\nPVpJBUZDOYjOhymgugTkpkxNK3I+GINTSOzfmG8FgAOvWP9u1njc5B+qAieN\n+hnzYybXskHu57KPcID3RtMldFZBNoZn52CyCo3jvpLaWMMKKrBGBvgUEhOK\nY5JQOX1OwjpZaEaNpt/q2NiwEvN1Ja+ylay03+He45mRfEl9G7PGvYFD35n/\nMGHNaAJhMWHe0u3m0W0d5dJdcB08DnFyXncYPBkZAEdHhlFM8SxRmYy4yFAo\negR6YXjyFtny7sNqjON1PmhlyGuC7rZKIP1hCz0vtq6qWK6W3IXxojSGNh3N\nQF8Y66T+ocr5K+pETb/rv7B7bRdRPcYS+9BdPsU4Dki38y0d/6fVlsWE/IOH\nt9JcvpDzLLyJICA6/wFU+uIuotB7J+FpH5PqhlxpGwWgIbVutdOIkP3wyrZM\nBhgj9SSq5JCEubMfMbmFBRDVrdJ3kEKdB2fNjiQ6LE+gwttvoEsieuLUg/z+\n3cmbHlzomxaGIoam93CESoRp2aGqKhUFtOePw200aBJ0qwnUN0LKluk1aSqs\nSUcOsDzP+NX0W/OTWR2+jAaUnc1vpIxQmCH4hP64XvKeN+kb0GtRHKnkx5h8\nacbM\r\n=MNzO\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD4Qns3GeEVDZSOeiVUSqPKMiG5CU7/HdNYm4O8ZLh5NwIgf//6Ml9cVp3f4GLcT3HBbjTZ/2c9Dx0USgjkLzCshd8="}]},"directories":{},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/retimer_3.0.0_1614683218944_0.8560379593629281"},"_hasShrinkwrap":false},"4.0.0":{"name":"retimer","version":"4.0.0","description":"Reschedulable Timer for your node needs","main":"retimer.js","types":"types.d.ts","scripts":{"lint":"standard","test":"npm run test:ci && npm run test:typescript","test:ci":"tape test.js | tap-dot","test:typescript":"tsd"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"keywords":["schedulable","reschedulable","timer","setTimeout"],"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"license":"MIT","bugs":{"url":"https://github.com/mcollina/retimer/issues"},"homepage":"https://github.com/mcollina/retimer#readme","devDependencies":{"fastbench":"^1.0.1","pre-commit":"^1.2.2","standard":"^17.1.0","tap-dot":"^2.0.0","tape":"^5.6.6","tsd":"^0.28.1"},"browser":{"./time.js":"./time-browser.js","./timers.js":"./timers-browser.js"},"dependencies":{"worker-timers":"^7.0.75"},"gitHead":"2bdb42dc1547203eafbaaa1cd14f7af9f8995bbf","_id":"retimer@4.0.0","_nodeVersion":"18.16.1","_npmVersion":"9.5.1","dist":{"integrity":"sha512-fZIVtvbOsQsxNSDhpdPOX4lx5Ss2ni+S72AUBitARpFhtA3UzrAjQ6gDtypB2/+l7L+1VQgAgpvAKY66mElH0w==","shasum":"41a8c09710281013ee83ef3a5f8279c02b5a4a8e","tarball":"https://registry.npmjs.org/retimer/-/retimer-4.0.0.tgz","fileCount":13,"unpackedSize":10714,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFFsBzHYRRzYc6qJ4paNSnCY6HofkimG1kx/AoPhWJFnAiA/44UOWm/MiIa5Zzya14dvgLu3+0uAuql9u6mtHWebCw=="}]},"_npmUser":{"name":"matteo.collina","email":"hello@matteocollina.com"},"directories":{},"maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/retimer_4.0.0_1691740784824_0.3141443630158989"},"_hasShrinkwrap":false}},"readme":"# retimer&nbsp;&nbsp;[![Build Status](https://travis-ci.org/mcollina/retimer.png)](https://travis-ci.org/mcollina/retimer)\n\nreschedulable setTimeout for your node needs. This library is built for\nbuilding a keep alive functionality across a large numbers of\nclients/sockets.\n\nRescheduling a 10000 functions 20 times with an interval of 50ms (see\n`bench.js`), with 100 repetitions:\n\n* `benchSetTimeout*100: 40.295s`\n* `benchRetimer*100: 36.122s`\n\n\n## Install\n\n```\nnpm install retimer --save\n```\n\n## Example\n\n```js\nvar retimer = require('retimer')\nvar timer = retimer(function () {\n  throw new Error('this should never get called!')\n}, 20)\n\nsetTimeout(function () {\n  timer.reschedule(50)\n  setTimeout(function () {\n    timer.clear()\n  }, 10)\n}, 10)\n```\n\n## API\n\n### retimer(callback, timeout, [...args])\n\nExactly like your beloved `setTimeout`.\nReturns a `Retimer object`\n\n### timer.reschedule(timeout)\n\nReschedule the timer.\nRetimer will not gove any performance benefit if the specified timeout comes __before__ the original timeout.\n\n### timer.clear()\n\nClear the timer, like your beloved `clearTimeout`.\n\n## How it works\n\nTimers are stored in a Linked List in node.js, if you create a lot of\ntimers this Linked List becomes massive which makes __removing a timer an expensive operation__.\nRetimer let the old timer run at its time, and schedule a new one accordingly, when the new one is __after__ the original timeout.\nThere is no performance gain when the new timeout is before the original one as retimer will just __remove the previous timer__.\n\n## License\n\nMIT\n","maintainers":[{"name":"matteo.collina","email":"hello@matteocollina.com"}],"time":{"modified":"2023-08-11T07:59:45.239Z","created":"2015-07-08T16:41:17.770Z","0.0.1":"2015-07-08T16:41:17.770Z","1.0.0":"2015-07-11T08:32:22.318Z","1.0.1":"2015-07-11T18:44:18.748Z","1.1.0":"2017-10-09T08:16:19.320Z","2.0.0":"2018-12-13T18:27:14.919Z","3.0.0":"2021-03-02T11:06:59.109Z","4.0.0":"2023-08-11T07:59:45.003Z"},"homepage":"https://github.com/mcollina/retimer#readme","keywords":["schedulable","reschedulable","timer","setTimeout"],"repository":{"type":"git","url":"git+https://github.com/mcollina/retimer.git"},"author":{"name":"Matteo Collina","email":"hello@matteocollina.com"},"bugs":{"url":"https://github.com/mcollina/retimer/issues"},"license":"MIT","readmeFilename":"README.md","users":{"akiva":true,"bat_coder":true}}