npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@edv4h/usketch-plugin-timter

v0.3.8

Published

Shared timers as **canvas shapes** (single source of truth). A `timer` shape is placeable/movable and syncs through the normal shapes map; timing runs against a shared `ServerClock` so every user agrees on "now". The plugin also surfaces every timer in th

Readme

@edv4h/usketch-plugin-timter

Shared timers as canvas shapes (single source of truth). A timer shape is placeable/movable and syncs through the normal shapes map; timing runs against a shared ServerClock so every user agrees on "now". The plugin also surfaces every timer in the Debug HUD's Controls dock (group "Timter").

The domain model (timer-model) is pure, framework-free, and time-source agnostic — every function takes an explicit serverNow.

Install

import { createTimterPlugin } from "@edv4h/usketch-plugin-timter";

const timter = createTimterPlugin({
  serverClock, // your shared ServerClock
  userId,      // optional, attribution (reserved)
});

Customizing the shape's look — renderShape

By default the timer renders with a built-in visual. To match your own design (hand-drawn theme, design tokens, custom controls), pass a renderShape render-prop. It receives the shape, its live TimerCore, a fresh serverNow (recomputed on every self-tick while running), and the timer actions. The plugin owns the tick and the store writes — your renderer only draws and calls actions.

import {
  createTimterPlugin,
  displayMs,
  formatDuration,
  isDone,
} from "@edv4h/usketch-plugin-timter";

createTimterPlugin({
  serverClock,
  renderShape: ({ shape, core, serverNow, actions }) => (
    <div className="my-timer" data-done={isDone(core, serverNow)}>
      <span className="my-timer__time">
        {formatDuration(displayMs(core, serverNow))}
      </span>
      <button type="button" onClick={actions.toggle}>
        {shape.running ? "pause" : "start"}
      </button>
      <button type="button" onClick={actions.reset}>reset</button>
    </div>
  ),
});

actions:

| action | effect | | --- | --- | | toggle() | start if paused, pause if running | | reset() | back to the configured, stopped state | | switchType() | advance to the next registered kind (paused only) | | adjust(deltaMs) | change the configured duration by deltaMs (duration-based kinds, paused only) |

Buttons should call e.stopPropagation() on onPointerDown so the click doesn't start a canvas drag — see defaultRenderTimerShape for the pattern.

Extend, don't replace

defaultRenderTimerShape is exported, so you can wrap the built-in visual instead of rewriting it:

import { defaultRenderTimerShape } from "@edv4h/usketch-plugin-timter";

createTimterPlugin({
  serverClock,
  renderShape: (ctx) => (
    <div className="my-frame">{defaultRenderTimerShape(ctx)}</div>
  ),
});

Adding a timer type — registerTimerKind

countdown and stopwatch are built in. Register your own kind (e.g. pomodoro) once at startup; the model transitions, the shape renderer, and the Controls dock all treat it like a built-in. switchType() cycles through every registered kind.

import { registerTimerKind, TIMER_KINDS } from "@edv4h/usketch-plugin-timter";

registerTimerKind("pomodoro", {
  ...TIMER_KINDS.countdown, // reuse countdown transitions
  icon: "🍅",
  // always a 25-minute work block
  initial: () => ({ anchorAt: null, accumMs: 25 * 60_000, durationMs: 25 * 60_000 }),
});

A TimerKind defines pure transitions over TimerCore:

interface TimerKind {
  icon?: string; // glyph used by the built-in renderer / Controls dock
  displayMs(c, serverNow): number;
  isDone(c, serverNow): boolean;
  onStart(c, serverNow): Pick<TimerCore, "anchorAt" | "accumMs">;
  onPause(c, serverNow): Pick<TimerCore, "anchorAt" | "accumMs">;
  initial(durationMs): Pick<TimerCore, "anchorAt" | "accumMs" | "durationMs">;
}

Model exports

start · pause · reset · initialCore · displayMs · isDone · formatDuration · getTimerKind · timerTypes · registerTimerKind · TIMER_KINDS — plus types TimerCore · TimerType · TimerKind.

Shape exports: TIMER_SHAPE_TYPE · TimerShapeData · defaultRenderTimerShape · makeTimerShape · dispatchTimerShapeAction — plus types TimerShapeRenderer · TimerRenderContext · TimerShapeActions.