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

blinkyterm

v0.1.2

Published

Agent-facing TUI runner built on Bun.Terminal and libghostty-vt.

Downloads

393

Readme

blinkyterm

Agent-facing TUI runner built on Bun.Terminal and libghostty-vt. Runner.spawn boots a child process attached to a pty, parses its output through Ghostty's VT engine, and yields stable frames you can for await. Send helpers cover text, keys, and raw bytes.

darwin-arm64 only (transitively, via libghostty-vt).

Install

Inside this monorepo:

{
  "dependencies": {
    "blinkyterm": "workspace:*"
  }
}

Downstream:

bun add blinkyterm

Spawn a child and read frames

import { Runner } from "blinkyterm";

await using runner = await Runner.spawn(["bash", "-l"], {
  cols: 80,
  rows: 24,
});

for await (const frame of runner.frames()) {
  console.log(`[${frame.reason}]`);
  console.log(frame.snapshot.text);
  if (frame.snapshot.text.includes("$ ")) break;
  if (frame.reason === "exited" || frame.reason === "crashed") break;
}

await using ensures the child is terminated and FFI resources are released when the block exits, even on throw.

Send text, keys, and bytes

await runner.sendText("ls -la\n");
await runner.sendKey("Enter");
await runner.sendBytes(new Uint8Array([0x03])); // Ctrl-C

sendKey accepts modifier flags as the second arg ({ ctrl: true }, etc.) and encodes through libghostty's keyboard encoder, so things like arrow keys and function keys come out correct under both legacy and Kitty keyboard modes.

Clean quit vs terminate

Try a clean exit first; fall back to signals only if the child won't go quietly:

await runner.sendText("exit\n");
const result = await runner.waitExit({ timeoutMs: 2_000 });
if (!result.exited) {
  await runner.terminate({ thenAfterMs: 500 });
}

terminate sends SIGTERM, then SIGKILL after thenAfterMs if the child is still alive.

Frozen snapshot semantics

Each Frame finalizes its text, vt, html, and per-cell views eagerly at emission time. Holding on to an old frame is safe: later writes to the terminal cannot mutate it, and the underlying VT buffer is free to scroll, repaint, or reset without disturbing frames you've already pulled off the iterator. Cost is paid up front, not on access.

Frame timing options

await Runner.spawn(argv, {
  frame: {
    minIntervalMs: 16,    // earliest a new frame may emit after the last
    maxIntervalMs: 250,   // hard cap — emit even if the stream is busy
    quiesceMs: 8,         // wait this long after the last write before emitting
    yieldOn: ["bell", "titleChange"],  // also emit on these reasons
  },
});

minIntervalMs rate-limits chatter; quiesceMs collapses bursts into a single frame after the writes settle; maxIntervalMs guarantees forward progress on a continuously busy pty; yieldOn adds VT effects as additional emit triggers.