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

@textui/terminal

v0.5.0

Published

Terminal adapters, capability detection, ANSI writing and input decoding for TextUI

Readme

@textui/terminal

npm license

What @textui/core needs to reach an actual terminal: adapters, capability detection, ANSI writing and input decoding.

npm install @textui/terminal
import { createApp } from '@textui/core';
import { createNodeTerminal } from '@textui/terminal';

const app = createApp({ terminal: createNodeTerminal(), root: <App /> });
await app.start();

Two adapters

createNodeTerminal() is the real one - stdin, stdout, resize, and the signal handling that puts the screen back the way it found it when the process dies.

createVirtualTerminal() has no tty at all. It is what the test harness and --static run on, and it is the reason a component that only works interactively is a component nobody can test cheaply.

Capabilities are detected, and can be lied to

Unicode level, colour depth, mouse, hyperlinks, the kitty keyboard protocol - detection is right almost always, and the times it is not are the times nobody is watching. So every capability can be forced, which is how you see the terminal somebody else is sitting at:

createNodeTerminal({ capabilities: { unicode: 'ascii', colors: 4 } });

Under the kitty protocol, ctrl+shift+f is a distinct stroke from ctrl+f. Without it the terminal sends the same byte for both, and no amount of decoding recovers the difference.

A frame you can keep

The screen is the output, so the next redraw destroys the frame that was wrong. Two functions write one out instead - both from the buffer the runtime last painted, neither needing a tty.

captureBuffer gives a frame a terminal can replay: every cell in order, no cursor control, so it can go in a file or an issue. colors: false strips the colour, which is the copy a diff can read.

bufferToSvg gives one a repository page can show, because an .ans file is only a screenshot on a terminal:

const svg = bufferToSvg(app.buffer(), {
  background: app.theme.colors.canvas,
  foreground: app.theme.colors.text,
});

Self-contained - no font, no stylesheet, no script, nothing fetched - which is what survives GitHub's image proxy. And it is text, so a committed screenshot diffs and CI can check it instead of somebody re-taking it.

What it needs from a stream

TerminalInput and TerminalOutput, which say what the adapter uses rather than which stream it is - setRawMode, columns, write, and half a dozen more. process.stdin and process.stdout satisfy them, so nothing changes for a caller, and so do the streams of runtimes that are not node.

That is also why the published types name no Node interfaces: a package with no dependencies should not need @types/node installed to compile.

Runtime

No dependencies beyond @textui/core. Uses process for stdio and signals, and no other Node API. Node 22+ and Bun.

Documentation

https://softov.github.io/textui/


Part of TextUI - documentation - getting started

@textui/kit one install · @textui/core the runtime · @textui/widgets the catalog · @textui/terminal adapters and input · @textui/testing the harness · @textui/cli the CLI