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

bootty.js

v0.2.0

Published

Browser WebGL renderer and wasm site backend for Bootty terminals.

Downloads

345

Readme

bootty.js

Web terminal rendering for Bootty frames.

bootty.js is for browser apps that want to draw a Bootty terminal frame into a <canvas>, plus Node tools that need to inspect or snapshot the same frame schema. It does not start a PTY, spawn a shell, or provide the Bootty desktop app.

Install

npm install bootty.js
pnpm add bootty.js
yarn add bootty.js
bun add bootty.js

Entrypoints

| Entrypoint | Runtime | Use it for | | --- | --- | --- | | bootty.js/browser | Browser | WebGL canvas rendering, input forwarding, clipboard/selection handling, and the bundled Rust site backend. | | bootty.js/node | Node | Frame construction, frame-to-text snapshots, and shared TypeScript types without DOM or WebGL dependencies. |

Mount a browser terminal

import { createRustSiteBackend, mountCanvasTerminal } from "bootty.js/browser";

const canvas = document.querySelector<HTMLCanvasElement>("#terminal");
if (!canvas) throw new Error("Missing #terminal canvas");

const terminal = await mountCanvasTerminal({
  canvas,
  backend: () => createRustSiteBackend({ page: "docs" }),
  cols: 96,
  rows: 32,
  fps: 30,
  onFrame(frame) {
    console.info(`${frame.cols}x${frame.rows}`);
  },
  onError(error) {
    console.error("Bootty terminal failed", error);
  },
});

await terminal.write("j");

mountCanvasTerminal owns the browser glue around a canvas:

  • creates a WebGlTerminalRenderer;
  • starts the supplied TerminalBackend;
  • forwards keyboard, mouse, resize, and copy events;
  • exposes refresh, resize, write, and dispose on the mounted terminal.

Provide your own backend

Any renderer backend implements the TerminalBackend contract.

import { createEmptyFrame, type TerminalBackend } from "bootty.js/browser";

export function createStaticBackend(): TerminalBackend {
  let frame = createEmptyFrame({ cols: 80, rows: 24 });

  return {
    label: "static",
    async start() {
      return frame;
    },
    async readFrame() {
      return frame;
    },
    async resize(request) {
      frame = createEmptyFrame({ cols: request.cols, rows: request.rows });
      return frame;
    },
    async write(input) {
      console.log(input);
    },
  };
}

The optional backend hooks are:

  • key(event) for keyboard events;
  • mouse(event) for pointer and wheel events;
  • fps(value) for host frame-rate reporting;
  • selectedText() for copy behavior.

Use frame utilities in Node

import { createBlankCell, createEmptyFrame, frameSize, frameToText } from "bootty.js/node";

const frame = createEmptyFrame({ cols: 24, rows: 4 });
frame.cells.push(...Array.from("Bootty", (text, x) => createBlankCell(x, 0, { text })));

console.log(frameSize(frame));
console.log(frameToText(frame));

bootty.js/node intentionally exports frame utilities and shared types only. Importing browser rendering from Node throws a clear runtime error instead of pretending DOM or WebGL are available.

Browser exports

import {
  WebGlTerminalRenderer,
  createRustSiteBackend,
  mountCanvasTerminal,
  rustSiteNavigation,
  frameToText,
  frameRows,
  frameSize,
  cellAt,
  createBlankCell,
  createEmptyFrame,
  selectedFrameText,
  type TerminalBackend,
  type WebTerminalFrame,
} from "bootty.js/browser";

Node exports

import {
  createBlankCell,
  createEmptyFrame,
  frameRows,
  frameSize,
  frameToText,
  cellAt,
  type TerminalBackend,
  type WebTerminalFrame,
} from "bootty.js/node";

Examples

  • examples/browser mounts the bundled Rust site backend into a full-page canvas.
  • examples/node/frame-summary.mjs creates a frame and prints a text snapshot.