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

termdot

v0.1.13

Published

Braille TUI — draw in the terminal with Unicode braille characters

Downloads

1,068

Readme

termdot

Draw in the terminal with Unicode braille characters (U+2800–U+28FF). Each character is a 2×4 pixel grid — giving you 8 dots per cell for high-resolution terminal graphics. Perfect for charts, games, animations, TUI for CLIs, and more.

Install

npm install termdot

Usage

import {createCanvas, set, frame, line} from 'termdot';

const c = createCanvas();

// Draw a sine wave
for (let x = 0; x < 100; x++) {
  set(c, x, Math.sin(x / 10) * 10 + 10);
}

// Draw a line
for (const pt of line(0, 0, 50, 20)) {
  set(c, pt.x, pt.y);
}

console.log(frame(c));

API

Sparse Canvas

Auto-expanding canvas backed by a Map. Grows as you draw.

createCanvas(options?)     // Create a canvas
set(canvas, x, y)          // Draw a pixel
unset(canvas, x, y)        // Erase a pixel
toggle(canvas, x, y)       // Toggle a pixel
get(canvas, x, y)          // Check if pixel is set
clear(canvas)              // Clear all pixels
setText(canvas, x, y, str) // Overlay text at position
frame(canvas, bounds?)     // Render to string
rows(canvas, bounds?)      // Render to string[]

Fixed Canvas

Fixed-size canvas backed by a Uint8Array. Fast, predictable bounds.

createFixedCanvas(width, height) // Create fixed canvas
fixedSet(canvas, x, y)           // Draw a pixel
fixedUnset(canvas, x, y)         // Erase a pixel
fixedToggle(canvas, x, y)        // Toggle a pixel
fixedGet(canvas, x, y)           // Check if pixel is set
fixedClear(canvas)               // Clear all pixels
fixedFrame(canvas, delimiter?)   // Render to string

Drawing

line(x1, y1, x2, y2)                    // Line generator (Bresenham)
polygon(centerX, centerY, sides, radius) // Regular polygon generator

Turtle Graphics

createTurtle(x?, y?)       // Create turtle at position
turtleForward(t, step)     // Move forward
turtleBack(t, step)        // Move backward
turtleRight(t, angle)      // Rotate clockwise
turtleLeft(t, angle)       // Rotate counter-clockwise
turtleUp(t)                // Lift brush (stop drawing)
turtleDown(t)              // Lower brush (start drawing)
turtleMove(t, x, y)        // Move to absolute position

Utilities

getTerminalSize()                    // Get terminal {width, height}
animate(canvas, generator, options?) // Run animation loop
normalize(coord)                     // Round to nearest int
getPos(x, y)                        // Pixel → cell coords

Braille Dot Layout

Each character cell maps to a 2×4 pixel grid:

,___,
|1 4|
|2 5|
|3 6|
|7 8|

## Scripts

```sh
pnpm build        # Bundle with tsup
pnpm test         # Run tests (vitest)
pnpm test:watch   # Run tests in watch mode
pnpm lint         # Lint with Biome
pnpm lint:fix     # Auto-fix lint issues
pnpm typecheck    # Type-check (tsc --noEmit)

Examples

npx tsx examples/basic.ts          # Sine waves, fills, toggles
npx tsx examples/turtle.ts         # Spirograph
npx tsx examples/clock.ts          # Animated analog clock
npx tsx examples/sine-wave.ts      # Animated sine wave
npx tsx examples/rotating-cube.ts  # 3D wireframe cube
npx tsx examples/cube.ts           # Perspective-projected cube
npx tsx examples/speed-test.ts     # Benchmark
npx tsx examples/spinners.ts       # Braille status indicators
npx tsx examples/kitchen-sink.ts   # Every feature demo

License

Apache-2.0 — Ahmad Awais