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

opentui-island

v0.4.0

Published

Embed OpenTUI islands inside Node host terminal UIs like pi-tui and Ink via a Bun sidecar.

Readme

opentui-island

Embed OpenTUI islands inside Node terminal UIs such as pi-tui and Ink.

npm version CI

Why

  • Keep your host app in Node.
  • Render the embedded OpenTUI island in a local Bun sidecar.
  • Reuse one island module across pi-tui, Ink, and lower-level hosts.

Install

Requirements:

  • Node 18+
  • Bun 1.3+
  • React

Install with pi-tui:

npm i opentui-island react @opentui/core @opentui/react @mariozechner/pi-tui

Install with Ink:

npm i opentui-island react @opentui/core @opentui/react ink

Quick start

Create one island module:

/** @jsxImportSource @opentui/react */

import { useKeyboard } from "@opentui/react";
import { useState } from "react";

export default function CounterIsland() {
  const [count, setCount] = useState(0);

  useKeyboard(
    (event) => {
      if (event.eventType !== "release" && event.name === "a") {
        setCount((value) => value + 1);
      }
    },
    { release: true },
  );

  return (
    <box style={{ width: "100%", height: "100%", paddingLeft: 1 }}>
      <text fg="#00ff88">{`count:${count}`}</text>
    </box>
  );
}

Use it in Ink.

Since Ink is React-based, this is the simpler host integration:

import { render } from "ink";
import { createIslandController } from "opentui-island";
import { InkSurface } from "opentui-island/ink";

const controller = await createIslandController({
  island: {
    module: new URL("./counter.island.tsx", import.meta.url),
  },
});

render(<InkSurface controller={controller} width={24} height={4} />);

Use it in pi-tui.

pi-tui is a little more manual because you are wiring the surface into a terminal app directly:

import { matchesKey, ProcessTerminal, TUI } from "@mariozechner/pi-tui";
import { createIslandController } from "opentui-island";
import { createPiTuiSurface } from "opentui-island/pi-tui";

const terminal = new ProcessTerminal();
const tui = new TUI(terminal);

const controller = await createIslandController({
  island: {
    module: new URL("./counter.island.tsx", import.meta.url),
  },
});

const surface = await createPiTuiSurface({
  controller,
  height: 4,
  initialWidth: terminal.columns,
  requestRender: () => tui.requestRender(),
});

tui.addChild(surface);
tui.setFocus(surface);

tui.addInputListener((data) => {
  if (matchesKey(data, "q") || matchesKey(data, "ctrl+c")) {
    void surface.destroy();
    tui.stop();
    return { consume: true };
  }

  return undefined;
});

tui.start();
await surface.sync(terminal.columns);
await surface.waitUntilReady();

Press a inside the island to increment the counter. Press q to quit in pi-tui.

Docs

Development

bun install
bun run check
bun test
bun run test:node-integration

Contributing

Security

Use the GitHub Security tab for sensitive reports.

License

MIT