{"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","tarball":"http://registry-npm.ywwl.com/reinterval/download/reinterval-1.1.0.tgz","integrity":"sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDCn6oUQQQAHde/QA6Epa3cJm6p+kOMvbndnqJdzMR4/AiA5yMQJFKJUp3lb8ZG3vFSfUvgSBAZU31OcC17agwr1xw=="}],"size":3223,"noattachment":false,"key":"/reinterval/-/reinterval-1.1.0.tgz"},"maintainers":[{"name":"4rzael","email":"maxime.agor23@gmail.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/reinterval-1.1.0.tgz_1466441868401_0.0532930011395365"},"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","publish_time":1466441869866,"_cnpm_publish_time":1466441869866,"dist-tags":{"latest":"1.1.0"}}