
Security News
Django Joins curl in Pushing Back on AI Slop Security Reports
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
frame-scheduling
Advanced tools
Asynchronous start of functions in JS. Supports priority and interrupt execution every 16 milliseconds, to achieve 60fps.
A tiny module which allows run a non-blocking layout many tasks.
import frameScheduling, { P_IMPORTANT } from 'frame-scheduling';
frameScheduling(() => { console.log('async task') });
Asynchronous running tasks in JavaScript based on requestAnimationFrame. Supports priority and interrupt execution every 16 milliseconds, to achieve 60fps.
# yarn
yarn add frame-scheduling
# npm
npm install --save frame-scheduling
import frameScheduling, { P_IMPORTANT, P_LOW } from 'frame-scheduling';
const result = [];
frameScheduling(() => { result.push('A') }, { priority: P_LOW })
frameScheduling(() => { result.push('B') })
frameScheduling(() => { result.push('C') }, { priority: P_IMPORTANT })
frameScheduling(() => { result.push('D') }, { priority: 1000 })
// after doing
console.log(result) // > ['D', 'C', 'B', 'A']
perform priority tasks first
import frameScheduling from 'frame-scheduling';
frameScheduling(() => lightFunction()) // light < 1ms exec
frameScheduling(() => heavyFunction()) // heavy > 17ms exec
frameScheduling(() => heavyFunction2()) // heavy > 17ms exec
frameScheduling(() => lightFunction2()) // light < 1ms exec
frameScheduling(() => lightFunction3()) // light < 1ms exec
/*
Runs in frame
| lightFunction
| heavyFunction
| heavyFunction2
| lightFunction2
| lightFunction3
*/
frame-scheduling aims to achieve 60 fps
It is possible to set the priority of the function. If the function has a low priority, then each execution skip adds +1 to the priority. Thus, low-priority tasks, when something is done.
FAQs
Asynchronous start of functions in JS. Supports priority and interrupt execution every 16 milliseconds, to achieve 60fps.
The npm package frame-scheduling receives a total of 30 weekly downloads. As such, frame-scheduling popularity was classified as not popular.
We found that frame-scheduling 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
Django has updated its security policies to reject AI-generated vulnerability reports that include fabricated or unverifiable content.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.