
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
@armniko/ticker
Advanced tools
Javascript/typescript library for running app loop with separate logical/drawing ticks and FPS limitation.
Javascript/typescript library for running app loop with separate logical/drawing ticks and FPS limitation.
npm install @armniko/ticker
import {Ticker} from '@armniko/ticker';
const ticker: Ticker = new Ticker({
onLogicTick: (): void => {
// update logic
},
onDrawTick: (): void => {
// draw
},
});
ticker.start();
Ticker constructor accepts options object with attributes:
To compensate missed ticks, use msBetweenTicks() and ticksMissed() Ticker methods when calculate logic.
// frames based animation
let x: number = 0;
const pxPerTick: number = 3;
const ticker: Ticker = new Ticker({
onLogicTick: (): void => {
x += pxPerTick * ticker.ticksMissed();
}
});
// time based animation
let x: number = 0;
const animationDurationMs: number = 2000;
const distancePx: number = 500;
const pxPerMs: number = distancePx / animationDurationMs;
const ticker: Ticker = new Ticker({
onLogicTick: (): void => {
x += pxPerMs * ticker.msBetweenTicks();
}
});
Under the hood Ticker collects draw metrics and calculate current FPS. This value can be retrieved from Ticker:
const ticker = new Ticker({
onDrawTick: (): void => {
console.log(ticker.fps());
}
});
FAQs
A lightweight, zero-dependency JavaScript/TypeScript library for running an application loop with separate logic and draw ticks, time scaling, FPS limiting, and low-FPS detection.
The npm package @armniko/ticker receives a total of 103 weekly downloads. As such, @armniko/ticker popularity was classified as not popular.
We found that @armniko/ticker demonstrated a healthy version release cadence and project activity because the last version was released less than 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
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.