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

@gizmo564/realtime

v0.1.1

Published

For real-time (not turn-based) games: a bots plugin where every bot and every away player has its own timer, so other players' moves never reset or starve them. The game supplies a plan (action + delay); the plugin supplies timing, lobby bots, away flags

Downloads

427

Readme

realtime

For games where any player can act at any moment (not one turn at a time), such as Sandwich Slam's Overstuffed.

// server: RoomDO config
protected readonly cfg = { logic, site: 'my-game', plugins: () => [botsRealtime(logic, { plan })] };

// the game's brain: what should this seat do, and how long does it think first? null = nothing until the state changes
const plan = (state, seatId, ctx, away) => ({ action: { type: 'play', card: 7 }, afterMs: 600 });

Use @gizmo564/bots-away for turn-based games and this package for real-time ones. Both give the same lobby bot message, away flags and host handoff (they share that code). The difference is the timers:

  • turn-based (bots-away): every automatic seat's timer restarts whenever the game state changes. Fine when one seat moves at a time. In a real-time game humans move constantly, so the bots would never play (there is a test showing exactly this).
  • real-time (this package): each bot, and each human who has been away past the grace period (25 s), keeps its own plan { action, at }. Other players' moves do not touch it. If the plan is no longer legal when its time comes, the game's act refuses it and the seat re-plans after 300 ms; after 3 refusals in a row it sleeps until the state changes (no alarm loop).

Plans are saved with the room, so they survive hibernation and the Nap Guard (shift). One automatic move happens per tick, so each move's events reach clients as their own snapshot.

Game side, the usual real-time rules still apply: the game's act must check timing itself using ctx.now (for example refuse plays before a countdown ends) and expose its next phase change through deadline/tick.

Not covered here: very fast human input is not rate-limited by the kit; each action is one save and one broadcast.