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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@effect-tui/core

v0.1.1

Published

Terminal UI library built with Effect

Downloads

251

Readme

@effect-tui/core

Low-level terminal UI primitives built with Effect.

Installation

bun add @effect-tui/core effect

Features

  • CellBuffer - Frame storage with glyph, style, and width-aware cells
  • Palette - Style deduplication for ANSI output
  • Colors - Color helpers (indexed, RGB, hex, grayscale)
  • Keys - Raw TTY key decoding
  • Spring animations - Analytical spring physics

Core Concepts

CellBuffer

A 2D grid of cells, each storing a codepoint, style ID, and width. Handles wide characters (CJK, emoji) correctly.

const buffer = new CellBuffer(80, 24)
buffer.put(0, 0, "Hello", styleId)     // Put string
buffer.drawCP(5, 0, 0x1F600, styleId)  // Draw codepoint (emoji)
buffer.fillRect(0, 1, 10, 3, 32, styleId) // Fill rectangle

Palette

Maps style objects to numeric IDs and generates ANSI escape sequences:

const palette = new Palette()
const style = palette.id({ fg: Colors.green, bg: Colors.black })
const ansi = palette.sgr(style)  // "\x1b[32;40m"

Colors

Colors.red           // Named color (indexed)
Colors.rgb(255,0,0)  // RGB
Colors.hex("#ff0000") // Hex
Colors.gray(12)      // Grayscale (0-23)
Colors.idx(196)      // 256-color index

Basic Usage

import { CellBuffer, Surface, Colors } from "@effect-tui/core"

// Create a buffer
const buffer = new CellBuffer(80, 24)
buffer.put(0, 0, "Hello", { fg: Colors.green })

// Render to terminal
const surface = new Surface(process.stdout)
surface.render(buffer)

Spring Physics

Analytical spring equations (matches framer-motion):

import { Spring } from "@effect-tui/core"

// Create spring with target
const spring = Spring.init(0)
const animated = Spring.to(spring, 100, { visualDuration: 0.35, bounce: 0.2 })

// Tick each frame
const next = Spring.tick(animated, 16)  // 16ms delta
const value = Spring.value(next)        // Current position
const done = Spring.settled(next)       // Animation complete?

Parameters:

  • visualDuration - Time to reach ~99% of target (seconds)
  • bounce - Overshoot amount (0 = no bounce, 0.5 = bouncy)

Related

License

MIT