Install
Download cranberry-forge-tempo-0.1.0.tgz from Cranberry Forge, then:
npm install ./cranberry-forge-tempo-0.1.0.tgzimport { Tempo } from "@cranberry-forge/tempo";
const tempo = new Tempo(
[
{ id: "dash", charges: 3, recharge: 2, cooldown: 0.15 },
{ id: "heal", charges: 2, recharge: 6, usesGlobalCooldown: false },
],
{ globalCooldown: 0.4 },
);
const result = tempo.tryUse("dash");
if (result.ok) startDash();
// Your existing game loop owns the clock, in seconds.
const events = tempo.tick(dt);
const hud = tempo.inspect("dash");The browser can also import index.js directly by relative URL; the package has no imports. TypeScript declarations ship with the archive. Modern runtimes must support private class fields, structuredClone and Object.hasOwn.