Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
request-idle-callback
Advanced tools
For more information refer to Using requestIdleCallback
npm install request-idle-callback
var ric = require('request-idle-callback')
// Executes myNonEssentialWork duting idle time on each frame or fallbacks to using setTimeout to run at most 50ms per frame
ric.requestIdleCallback(myNonEssentialWork);
function myNonEssentialWork (deadline) {
while (deadline.timeRemaining() > 0)
doWorkIfNeeded();
}
deadline
is an object containing:
deadline.didTimeout
boolean indicating if it is still time to deadline.deadline.timeRemaining
function that returns remaining time.Removes callback from the queue or calls clearTimeout.
node tests.js
MIT
FAQs
Browser shim for window.requestIdleCallback
The npm package request-idle-callback receives a total of 172 weekly downloads. As such, request-idle-callback popularity was classified as not popular.
We found that request-idle-callback demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.