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

@yum-tty/blueberry

v0.2.0

Published

Cell-based terminal rendering primitives for Bun. A TypeScript port of Ultraviolet.

Readme

Blueberry

Cell-based terminal rendering primitives for Bun. A TypeScript port of Ultraviolet.

Blueberry provides the core building blocks for building terminal user interfaces, including cell-based rendering, screen buffers, styled strings, and layout constraints.

Installation

bun add github:yum-tty/blueberry

Or install from a specific package:

bun add blueberry

Quick Start

import { ScreenBuffer, TerminalRenderer, Context } from "blueberry"

// Create a renderer
const renderer = new TerminalRenderer()
renderer.init(true) // Enter alternate screen

// Create a buffer
const buffer = new ScreenBuffer(80, 24)

// Create a context
const ctx = new Context(buffer)

// Draw something
ctx.drawString("Hello, World!")
buffer.fill(0, 1, 80, 1, "─")

// Render to terminal
renderer.render(buffer)

Features

Cell-Based Rendering

import { newCell, emptyCell, cellEquals } from "blueberry"

const cell = newCell("A", { bold: true, foreground: "#FF0000" })
const empty = emptyCell()

console.log(cellEquals(cell, empty)) // false

Styled Strings

import { StyledString } from "blueberry"

const styled = new StyledString("Hello", [
  { text: "Hello", style: { bold: true, foreground: "#FF0000" } },
])

console.log(styled.width()) // 5
console.log(styled.height()) // 1

Screen Buffers

import { ScreenBuffer } from "blueberry"

const buffer = new ScreenBuffer(80, 24)

// Set a cell
buffer.setCell(0, 0, { char: "A", style: null, width: 1 })

// Fill a region
buffer.fill(0, 0, 10, 5, "X", { background: "#FF0000" })

// Draw a string
buffer.drawString("Hello", 0, 0, { foreground: "#00FF00" })

Terminal Renderer

import { TerminalRenderer } from "blueberry"

const renderer = new TerminalRenderer()
renderer.init(true) // Enter alternate screen

// Render a view
renderer.render("Hello, World!")

// Clear the screen
renderer.clear()

// Restore terminal state
renderer.restore()

Layout Constraints

import { Len, Min, Max, Fill, Percent } from "blueberry/layout"

const constraint = Len(20)
const resolved = resolveConstraint(constraint, 100) // 20

const fill = Fill(0.5)
const resolved = resolveConstraint(fill, 100) // 50

Screen Context

import { Context } from "blueberry/screen"
import { ScreenBuffer } from "blueberry"

const buffer = new ScreenBuffer(80, 24)
const ctx = new Context(buffer)

ctx.moveTo(0, 0)
ctx.setStyle({ bold: true, foreground: "#FF0000" })
ctx.drawString("Hello!")

API Reference

Cell

| Function | Description | |----------|-------------| | newCell(char, style?) | Create a new cell | | emptyCell() | Create an empty cell | | isZero(cell) | Check if a cell is empty | | cellEquals(a, b) | Compare two cells |

StyledString

| Method | Description | |--------|-------------| | width() | Get the visible width | | height() | Get the number of lines | | draw(setCell, bounds) | Draw to a buffer |

ScreenBuffer

| Method | Description | |--------|-------------| | getWidth() | Get buffer width | | getHeight() | Get buffer height | | getCell(x, y) | Get a cell | | setCell(x, y, cell) | Set a cell | | clear() | Clear the buffer | | resize(width, height) | Resize the buffer | | equals(other) | Compare buffers | | drawString(str, x, y, style?) | Draw a string | | fill(x, y, w, h, char?, style?) | Fill a region |

TerminalRenderer

| Method | Description | |--------|-------------| | init(altScreen) | Initialize the renderer | | render(view) | Render a frame | | clear() | Clear the screen | | showCursor() | Show the cursor | | hideCursor() | Hide the cursor | | moveTo(x, y) | Move the cursor | | getSize() | Get terminal size | | restore() | Restore terminal state |

Context

| Method | Description | |--------|-------------| | moveTo(x, y) | Set position | | setStyle(style) | Set style | | drawString(str) | Draw string | | drawStyledString(str, style) | Draw styled string | | clear() | Clear screen | | fill(x, y, w, h, char?, style?) | Fill region |

Layout

| Function | Description | |----------|-------------| | Len(value) | Fixed length constraint | | Min(value) | Minimum constraint | | Max(value) | Maximum constraint | | Fill(ratio?) | Fill available space | | Ratio(n, d) | Ratio constraint | | Percent(value) | Percent constraint | | resolveConstraint(c, available) | Resolve constraint |

Contributing

Contributions are welcome! Please read our Contributing Guide first.

License

MIT


Based on Ultraviolet by Charm.