{"_id":"requestidlecallback","_rev":"7-e67333e1ea298a6611c917ff7f701c41","name":"requestidlecallback","description":"A polyfill for the requestIdleCallback.","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"requestidlecallback","version":"0.1.0","description":"A polyfill for the requestIdleCallback.","main":"index.js","filename":"index.js","author":{"name":"Alexander Farkas","email":"info@corrupt-system.de"},"repository":{"type":"git","url":"git+ssh://git@github.com/aFarkas/requestIdleCallback.git"},"scripts":{"test":"mocha-phantomjs test/index.html"},"license":"MIT","devDependencies":{"chai":"^3.4.0","jshint":"^2.8.0","mocha":"^2.3.3","mocha-phantomjs":"^4.0.1","sinon":"^1.17.2"},"gitHead":"a237d6c6b562c4a14eef8215d081aaf55b0fb990","bugs":{"url":"https://github.com/aFarkas/requestIdleCallback/issues"},"homepage":"https://github.com/aFarkas/requestIdleCallback#readme","_id":"requestidlecallback@0.1.0","_shasum":"d1bc5ada9f4ffb8d3e3519d1a2394fd69770beed","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"afarkas","email":"info@corrupt-system.de"},"dist":{"shasum":"d1bc5ada9f4ffb8d3e3519d1a2394fd69770beed","tarball":"https://registry.npmjs.org/requestidlecallback/-/requestidlecallback-0.1.0.tgz","integrity":"sha512-AKtbD8bQAblpK6K0b0/D+vCSncOugRkUMvIcgEt1Qwpp/RT9cSjM6VjMH3jhyCBW2aEWzNFxm1jCDoK9TuXpVQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH7TjUgo1Nzv0x5gTpgGKir24QwXmeRndcYOKqmuVfRTAiEAm8irhQ6VDJq3wGY3QLbApJC60gjozUn2H7Aw7X7Sa/s="}]},"maintainers":[{"name":"afarkas","email":"info@corrupt-system.de"}],"directories":{}},"0.2.0":{"name":"requestidlecallback","version":"0.2.0","description":"A polyfill for the requestIdleCallback.","main":"index.js","filename":"index.js","author":{"name":"Alexander Farkas","email":"info@corrupt-system.de"},"repository":{"type":"git","url":"git+ssh://git@github.com/aFarkas/requestIdleCallback.git"},"scripts":{"test":"mocha-phantomjs test/index.html"},"license":"MIT","devDependencies":{"chai":"^3.4.0","jshint":"^2.8.0","mocha":"^2.3.3","mocha-phantomjs":"^4.0.1","sinon":"^1.17.2"},"gitHead":"c630417d9160e16a50ca6711f44212f4fd23da92","bugs":{"url":"https://github.com/aFarkas/requestIdleCallback/issues"},"homepage":"https://github.com/aFarkas/requestIdleCallback#readme","_id":"requestidlecallback@0.2.0","_shasum":"ba90adc71e14dae7be94ebb86d2a0b71e64f197d","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.1","_npmUser":{"name":"afarkas","email":"info@corrupt-system.de"},"dist":{"shasum":"ba90adc71e14dae7be94ebb86d2a0b71e64f197d","tarball":"https://registry.npmjs.org/requestidlecallback/-/requestidlecallback-0.2.0.tgz","integrity":"sha512-D92W5Hz3DaiB1hvb2qrjoczHN6LFfGaZkLi/TPt3XxUIID0hFziG3AUCp3J90oL/lHZBmPxKDGujDYYB4DAdRg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8Wtm2kjw04CbGs8oeqMn95GT6HZjp22HuyEhqGWktCwIgIO1e0R6bvT5Ee6RvXRcAMlLUg3QSLWlkY3u4DKotCxg="}]},"maintainers":[{"name":"afarkas","email":"info@corrupt-system.de"}],"directories":{}},"0.3.0":{"name":"requestidlecallback","version":"0.3.0","description":"A polyfill for the requestIdleCallback.","main":"index.js","filename":"index.js","author":{"name":"Alexander Farkas","email":"info@corrupt-system.de"},"repository":{"type":"git","url":"git+ssh://git@github.com/aFarkas/requestIdleCallback.git"},"scripts":{"test":"mocha-phantomjs test/index.html"},"license":"MIT","devDependencies":{"chai":"^3.4.0","jshint":"^2.8.0","mocha":"^2.3.3","mocha-phantomjs":"^4.0.1","sinon":"^1.17.2"},"gitHead":"5094a0e988d12a67772be6c77ff7b5a726c87b68","bugs":{"url":"https://github.com/aFarkas/requestIdleCallback/issues"},"homepage":"https://github.com/aFarkas/requestIdleCallback#readme","_id":"requestidlecallback@0.3.0","_shasum":"6fb74e0733f90df3faa4838f9f6a2a5f9b742ac5","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.5.0","_npmUser":{"name":"afarkas","email":"info@corrupt-system.de"},"dist":{"shasum":"6fb74e0733f90df3faa4838f9f6a2a5f9b742ac5","tarball":"https://registry.npmjs.org/requestidlecallback/-/requestidlecallback-0.3.0.tgz","integrity":"sha512-TWHFkT7S9p7IxLC5A1hYmAYQx2Eb9w1skrXmQ+dS1URyvR8tenMLl4lHbqEOUnpEYxNKpkVMXUgknVpBZWXXfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH48iVFqmx/HVqeAiwNg0Y9oDNqxELfdY/R+ILOxq9cEAiBlCfwudcTupIkS7lgzXcoPk1OSJk91Ra4qvFlbx57krw=="}]},"maintainers":[{"name":"afarkas","email":"info@corrupt-system.de"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/requestidlecallback-0.3.0.tgz_1477261044204_0.685744249029085"},"directories":{}}},"readme":"#`requestIdleCallback` polyfill/shim [![Build Status](https://api.travis-ci.org/aFarkas/requestIdleCallback.svg?branch=master)](https://travis-ci.org/aFarkas/requestIdleCallback)\n\nThis is a polyfill/shim for the `requestIdleCallback` and `cancelIdleCallback` API. Also fixes early API implementation. \n\nFor more information see the [Cooperative Scheduling of Background Tasks Draft](http://www.w3.org/TR/requestidlecallback/).\n\n##Installation\nInclude the \"index.js\" in your website and use `requestIdleCallback` and `cancelIdleCallback` according to the specification.\n\n##How it works\n`requestIdleCallback` can't be really polyfilled. Therefore `requestIdleCallback` basically includes a throttle like function, that uses some heuristics to detect a) long running frames and b) user input as also DOM mutations to adapt accordingly. `requestIdleCallback` also tries to get the time right after a frame commit. The `deadline.timeRemaining()` either starts with 7ms or with 22ms for the first scheduled callback.\n\nIf multiple functions are scheduled with the `requestIdleCallback` shim for the same idle time, the shim makes sure to split those functions as soon as `timeRemaining()` is exceeded.\n\n##Usage\n\nIf you have a fast or a non-splittable task:\n\n```js\nrequstIdleCallback(function(){\n\t//your task\n});\n```\n\nIn case you have a heavy and splittable task you can use efficient script yielding technique:\n\n```js\nrequestIdleCallback(function(deadline){\n\twhile(tasks.length && deadline.timeRemaining() > 0){\n\t\ttasks.shift()();\n\t}\n\t\n\tif(tasks.length){\n\t\trequestIdleCallback(runTasks);\n\t}\n});\n```\n\n**Reading vs writing layout:** `requestIdleCallback` is mainly for layout neutral or layout reading/measuring tasks. In case you want to write layout/manipulate the DOM consider using `requestAnimationFrame` instead.\n\nOf course `requestIdleCallback` can also be combined with `requestAnimationFrame`:\n\n```js\nrequstIdleCallback(function(){\n\tvar width = element.offsetWidth;\n\t\n\trequestAnimationFrame(function(){\n\t\telement.classList[width > 600 ? 'add' : 'remove']('is-large');\n\t});\n});\n```\n","maintainers":[{"name":"afarkas","email":"info@corrupt-system.de"}],"time":{"modified":"2022-06-26T11:34:38.809Z","created":"2015-11-01T13:00:05.967Z","0.1.0":"2015-11-01T13:00:05.967Z","0.2.0":"2015-11-01T18:43:27.243Z","0.3.0":"2016-10-23T22:17:25.527Z"},"homepage":"https://github.com/aFarkas/requestIdleCallback#readme","repository":{"type":"git","url":"git+ssh://git@github.com/aFarkas/requestIdleCallback.git"},"author":{"name":"Alexander Farkas","email":"info@corrupt-system.de"},"bugs":{"url":"https://github.com/aFarkas/requestIdleCallback/issues"},"license":"MIT","readmeFilename":"README.md","users":{"aidenzou":true,"ahmedelgabri":true}}