
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, Time} from '@armniko/ticker';
const element: { position: { x: number, y: number } } = {position: {x: 0, y: 0}};
const animation: { durationMs: number, distancePx: number } = {
durationMs: 2000,
distancePx: 500,
}
const ticker: Ticker = new Ticker();
ticker.addLogicTask((time: Time): void => {
const pxPerMs: number = animation.distancePx / animation.durationMs;
element.position.x += pxPerMs * time.deltaMs;
});
ticker.addDrawTask((): void => {
// draw
});
Ticker instance methods:
Before (v1):
import {Ticker} from '@armniko/ticker';
const element: { position: { x: number, y: number } } = {position: {x: 0, y: 0}};
const animation: { durationMs: number, distancePx: number } = {
durationMs: 2000,
distancePx: 500,
}
const ticker: Ticker = new Ticker({
onLogicTick: (): void => {
const pxPerMs: number = distancePx / animationDurationMs;
element.position.x += pxPerMs * ticker.msBetweenTicks();
},
onDrawTick: (): void => {
// draw element
},
});
ticker.start();
After (v2):
import {Ticker, Time} from '@armniko/ticker';
const element: { position: { x: number, y: number } } = {position: {x: 0, y: 0}};
const animation: { durationMs: number, distancePx: number } = {
durationMs: 2000,
distancePx: 500,
}
const ticker: Ticker = new Ticker();
ticker.addLogicTask((time: Time): void => {
const pxPerMs: number = distancePx / animationDurationMs;
element.position.x += pxPerMs * time.deltaMs;
});
ticker.addDrawTask((): void => {
// draw element
});
ticker.start();
| v2.0.0 |
Multiple tick callbacks support Added TickerMock for testing Deprecated: constructor options, msBetweenTicks(), ticksMissed(). (See migration v1 -> v2) |
| v1.1.0 | Precompile UMD and ESM |
| v1.0.0 | Initial version |
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 79 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.