{"_id":"reinterval","_rev":"2993956","name":"reinterval","description":"reschedulable setInterval for node.js","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"4rzael","email":""}],"time":{"modified":"2023-08-28T09:19:11.000Z","created":"2015-11-26T14:32:37.580Z","1.1.0":"2016-06-20T16:57:49.866Z","1.0.2":"2015-11-27T10:19:39.202Z","1.0.1":"2015-11-26T15:15:30.295Z","1.0.0":"2015-11-26T14:32:37.580Z"},"users":{},"author":{"name":"4rzael"},"repository":{"type":"git","url":"git+https://github.com/4rzael/reInterval.git"},"versions":{"1.1.0":{"name":"reinterval","version":"1.1.0","description":"reschedulable setInterval for node.js","main":"index.js","scripts":{"test":"mocha tests/"},"repository":{"type":"git","url":"git+https://github.com/4rzael/reInterval.git"},"keywords":["node","nodejs","setInterval","retimer","schedule"],"author":{"name":"4rzael"},"license":"MIT","bugs":{"url":"https://github.com/4rzael/reInterval/issues"},"homepage":"https://github.com/4rzael/reInterval","devDependencies":{"mocha":"^2.3.4","chai":"^3.4.1","chai-as-promised":"^5.1.0","es6-shim":"^0.33.13"},"gitHead":"fdd4eb0345170fa62dee3d82b0cf1c8cd649d0e6","_id":"reinterval@1.1.0","_shasum":"3361ecfa3ca6c18283380dd0bb9546f390f5ece7","_from":".","_npmVersion":"2.15.5","_nodeVersion":"4.4.5","_npmUser":{"name":"4rzael","email":"maxime.agor23@gmail.com"},"dist":{"shasum":"3361ecfa3ca6c18283380dd0bb9546f390f5ece7","size":3223,"noattachment":false,"key":"/reinterval/-/reinterval-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/reinterval/download/reinterval-1.1.0.tgz"},"maintainers":[{"name":"4rzael","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/reinterval-1.1.0.tgz_1466441868401_0.0532930011395365"},"directories":{},"publish_time":1466441869866,"_hasShrinkwrap":false,"_cnpm_publish_time":1466441869866,"_cnpmcore_publish_time":"2021-12-16T14:27:31.964Z"},"1.0.2":{"name":"reinterval","version":"1.0.2","description":"reschedulable setInterval for node.js","main":"index.js","scripts":{"test":"mocha tests/"},"repository":{"type":"git","url":"https://github.com/4rzael/reInterval.git"},"keywords":["node","nodejs","setInterval","retimer","schedule"],"author":{"name":"4rzael"},"license":"MIT","bugs":{"url":"https://github.com/4rzael/reInterval/issues"},"homepage":"https://github.com/4rzael/reInterval","devDependencies":{"mocha":"^2.3.4","chai":"^3.4.1","chai-as-promised":"^5.1.0","es6-shim":"^0.33.13"},"gitHead":"c65ac71e26529dd891035b601bd22a3f0edcb467","_id":"reinterval@1.0.2","_shasum":"029056fb7637844bec872f36f2c07b0d7c112e6d","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"4rzael","email":"maxime.agor23@gmail.com"},"maintainers":[{"name":"4rzael","email":""}],"dist":{"shasum":"029056fb7637844bec872f36f2c07b0d7c112e6d","size":2662,"noattachment":false,"key":"/reinterval/-/reinterval-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/reinterval/download/reinterval-1.0.2.tgz"},"directories":{},"publish_time":1448619579202,"_hasShrinkwrap":false,"_cnpm_publish_time":1448619579202,"_cnpmcore_publish_time":"2021-12-16T14:27:32.210Z"},"1.0.1":{"name":"reinterval","version":"1.0.1","description":"reschedulable setInterval for node.js","main":"index.js","scripts":{"test":"mocha test/*.js"},"repository":{"type":"git","url":"https://github.com/4rzael/reInterval.git"},"keywords":["node","nodejs","setInterval","retimer","schedule"],"author":{"name":"4rzael"},"license":"MIT","bugs":{"url":"https://github.com/4rzael/reInterval/issues"},"homepage":"https://github.com/4rzael/reInterval","devDependencies":{"mocha":"^2.3.4","chai":"^3.4.1","chai-as-promised":"^5.1.0","es6-shim":"^0.33.13"},"gitHead":"744cbbb45ebdf82193d51a808753b7280b42803d","_id":"reinterval@1.0.1","_shasum":"88dfa9f76e94eb8e757230fe6120f447f47cd936","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"4rzael","email":"maxime.agor23@gmail.com"},"maintainers":[{"name":"4rzael","email":""}],"dist":{"shasum":"88dfa9f76e94eb8e757230fe6120f447f47cd936","size":2470,"noattachment":false,"key":"/reinterval/-/reinterval-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/reinterval/download/reinterval-1.0.1.tgz"},"directories":{},"publish_time":1448550930295,"_hasShrinkwrap":false,"_cnpm_publish_time":1448550930295,"_cnpmcore_publish_time":"2021-12-16T14:27:32.438Z"},"1.0.0":{"name":"reinterval","version":"1.0.0","description":"reschedulable setInterval for node.js","main":"index.js","scripts":{"test":"echo -e '\\nTests not implemented yet\\n'"},"repository":{"type":"git","url":"https://github.com/4rzael/reinterval.git"},"keywords":["node","nodejs","setInterval","retimer","schedule"],"author":{"name":"4rzael"},"license":"MIT","bugs":{"url":"https://github.com/4rzael/reinterval/issues"},"homepage":"https://github.com/4rzael/reinterval","devDependencies":{"mocha":"^2.3.4","chai":"^3.4.1","chai-as-promised":"^5.1.0"},"dependencies":{"es6-shim":"^0.33.13"},"gitHead":"2b1fe7eee90e3c315806c90f5b43006b5bc750a4","_id":"reinterval@1.0.0","_shasum":"65bb67e497239de585e6b3d649b7aed463984d6d","_from":"./","_npmVersion":"1.4.28","_npmUser":{"name":"4rzael","email":"maxime.agor23@gmail.com"},"maintainers":[{"name":"4rzael","email":""}],"dist":{"shasum":"65bb67e497239de585e6b3d649b7aed463984d6d","size":2444,"noattachment":false,"key":"/reinterval/-/reinterval-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/reinterval/download/reinterval-1.0.0.tgz"},"directories":{},"publish_time":1448548357580,"_hasShrinkwrap":false,"_cnpm_publish_time":1448548357580,"_cnpmcore_publish_time":"2021-12-16T14:27:32.683Z"}},"readme":"# reInterval\n![TRAVIS](https://travis-ci.org/4rzael/reInterval.svg)\n\n[![NPM](https://nodei.co/npm/reinterval.png?downloads=true&downloadRank=true)](https://nodei.co/npm/reinterval/)\n\nReschedulable setInterval for node.js.\n\n###### Note: Work highly inspired by [mcollina](https://github.com/mcollina)'s [retimer](https://github.com/mcollina/retimer).\n\n## Example\n\n```js\nvar reInterval = require('reInterval');\n\nvar inter = reInterval(function () {\n  console.log('this should be called after 13s');\n}, 10 * 1000);\n\n// This will reset/reschedule the interval after 3 seconds, therefore\n// the interval callback won't be called for at least 13 seconds.\nsetTimeout(function () {\n  inter.reschedule(10 * 1000);\n}, 3 * 1000);\n```\n\n\n## API:\n\n###`reInterval(callback, interval[, param1, param2, ...])`\n\nThis is exactly like setInterval.\n\n_Arguments:_\n  - `callback`: The callback to be executed repeatedly.\n  - `interval`: The number of milliseconds (thousandths of a second) that the `reInterval()` function should wait before each call to `callback`.\n  - `param1, param2, ...`: *(OPTIONAL)* These arguments are passed to the `callback` function.\n\n####returns an `interval` object with the following methods:\n\n###`interval.reschedule([interval])`\n\nThis function resets the `interval` and restarts it now.\n\n_Arguments:_\n  - `interval`: *(OPTIONAL)* This argument can be used to change the amount of milliseconds to wait before each call to the `callback` passed to the `reInterval()` function.\n\n###`interval.clear()`\n\nThis function clears the interval. Can be used to temporarily clear the `interval`, which can be rescheduled at a later time.\n\n###`interval.destroy()`\n\nThis function clears the interval, and will also clear the `callback` and `params` passed to reInterval, so calling this essentially just makes this object ready for overwriting with a new `interval` object. \n\n#### Note:\nPlease ensure that either the `interval.clear()` or `interval.destroy()` function is called before overwriting the `interval` object, because the internal `interval` can continue to run in the background unless cleared.\n\n## license\n\n**MIT**\n","_attachments":{},"homepage":"https://github.com/4rzael/reInterval","bugs":{"url":"https://github.com/4rzael/reInterval/issues"},"license":"MIT"}