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

buffalo-tui

v1.0.3

Published

A beginner friendly TUI framework available on various package managers for Node.js projects

Readme

Buffalo TUI Framework

A beginner friendly TUI framework available on various package managers for Node.js projects.

Features

  1. Floating Windows are movable, overlapping windows with ZIndex support.
  2. RGB Color Support allows for full 24-bit RGB coloring with ANSI escape sequences.
  3. Input Handling gives native keyboard event handling.
  4. Interactive Elements such as input fields, buttons, and labels with support for keyboard navigation.
  5. Control Bar allows you to write a useful status bar with nice keyboard shortcuts.
  6. Efficient Rendering uses a buffer-based rendering system for seamless render updates.

Install Buffalo

Buffalo is available for anyone on the NPM marketplace.

[!NOTE] As of Tuesday, February 10th, 2026, Buffalo does not support TypeScript type declarations!

Install Buffalo using the Node Package Manager:

npm install buffalo-tui

Demo Preview

Getting Started

Writing your first TUI with Buffalo is extremely easy and can be done using the code below:

import { Screen, Frame, ColorManager, InputManager } from "buffalo-tui";

const screen = new Screen();
const inputManager = new InputManager();

screen.enterFullscreen();

// (sizeX, sizeY, posX, posY, windowTitle, color)
const frame = new Frame(
    50, 20,
    5, 2,
    "My Buffalo Program",
    new ColorManager().setColor(100, 150, 255)
);

frame.setBackgroundColor(15, 15, 25);
frame.addContent(2, 2, "Hello, Buffalo!", new ColorManager().setColor(255, 255, 100));

screen.addElement(frame);
screen.setControlBar("Press Q to quit");

inputManager.onAny((keyName) => {
    if (keyName === "q" || keyName === "Q") {
        inputManager.stop();
        screen.exitFullscreen();
        process.exit(0);
    }
});

inputManager.start();
screen.render();

Learn Buffalo through API Documentation

Screen

Main class for managing the terminal display.

const screen = new Screen();

Properties:

  • width - Terminal width in characters
  • height - Terminal height in characters
  • elements - Array of elements to render

Methods:

  • enterFullscreen() - Enter fullscreen mode
  • exitFullscreen() - Exit fullscreen mode
  • render() - Render all elements to terminal
  • addElement(element) - Add an element to the screen
  • removeElement(element) - Remove an element
  • setControlBar(text) - Set control bar text
  • writeAt(x, y, char, color) - Write a single character
  • writeString(x, y, str, color) - Write a string
  • drawRect(x, y, width, height, filled, char, color) - Draw a rectangle
  • drawLine(x1, y1, x2, y2, char, color) - Draw a line
  • getUsableHeight() - Get height minus control bar

Frame

Floating window element with border, title, and content.

Constructor:

new Frame(sizeX, sizeY, posX, posY, windowTitle, borderColor)

Parameters:

  • sizeX - Width of the frame
  • sizeY - Height of the frame
  • posX - X position on screen
  • posY - Y position on screen
  • windowTitle - Title displayed on top border
  • borderColor - ColorManager instance for border

Methods:

  • setWindowTitle(title) - Update window title
  • setBorderColor(R, G, B) - Set border color (0-255 RGB)
  • setBackgroundColor(R, G, B) - Set background color
  • addContent(x, y, text, color) - Add text content at position
  • clearContent() - Remove all content
  • show() - Make frame visible
  • hide() - Make frame invisible
  • setZIndex(z) - Set layering order (higher = front)

Input

Text input field element.

Constructor:

new Input(posX, posY, width, label, color)

Parameters:

  • posX - X position on screen
  • posY - Y position on screen
  • width - Width of input field
  • label - Label text above input
  • color - ColorManager instance (optional)

Methods:

  • setValue(value) - Set input value
  • getValue() - Get current value
  • setFocus(focused) - Set focus state
  • show() / hide() - Visibility control

Button

Clickable button element.

Constructor:

new Button(posX, posY, text, color)

Parameters:

  • posX - X position on screen
  • posY - Y position on screen
  • text - Button text
  • color - ColorManager instance (optional)

Methods:

  • setText(text) - Update button text
  • setHovered(hovered) - Set hover state
  • show() / hide() - Visibility control

Label

Static text label element.

Constructor:

new Label(posX, posY, text, color)

Parameters:

  • posX - X position on screen
  • posY - Y position on screen
  • text - Label text
  • color - ColorManager instance (optional)

Methods:

  • setText(text) - Update label text
  • setColor(R, G, B) - Set text color
  • show() / hide() - Visibility control

ColorManager

RGB color management with ANSI conversion.

Methods:

  • setColor(R, G, B) - Set RGB color (0-255 each)
  • getColor() - Returns {R, G, B} object
  • toANSIForeground() - Convert to ANSI foreground code
  • toANSIBackground() - Convert to ANSI background code
  • static reset() - Get ANSI reset code

InputManager

Keyboard input handling.

Methods:

  • start() - Start capturing keyboard input
  • stop() - Stop capturing input
  • onAny(callback) - Register callback for any key: (keyName, rawKey) => {}

Key Events:

  • keyName - Human-readable key name
  • rawKey - Raw escape sequence