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

embed-terminal

v0.1.2

Published

Embeddable web terminal — serve any directory's terminal in your browser

Readme

embed-terminal

Embeddable web terminal server for any directory.

Screenshots

PC

PC version

Mobile

Mobile version

Features

  • xterm.js — full terminal emulation in the browser
  • node-pty — real PTY backend via WebSocket
  • Session management — automatic reconnection with output replay
  • IME support — works with CJK input methods
  • Mobile support — Control bar auto-appears on screens ≤768px wide. Buttons for Ctrl/Shift/Tab/Esc/Enter/Arrow keys and more. Double-tap Ctrl/Shift to lock.
  • Theme presets — dark, light, monokai, dracula (or custom)

Quick Start

npx embed-terminal
npx embed-terminal --cwd /path/to/project --port 8080

By default, your login shell ($SHELL, e.g. bash or zsh) is launched. Opens a browser terminal at http://0.0.0.0:3456.

CLI Options

| Option | Default | Description | |---|---|---| | --cwd <path> | process.cwd() | Working directory for the terminal | | --port <number> | 3456 | Server port | | --host <address> | 0.0.0.0 | Server host |

npx embed-terminal --cwd ~/projects/myapp --port 8080

Library Usage (Server)

const http = require('http');
const { createChatServer } = require('embed-terminal');

const server = http.createServer();

const chat = createChatServer(server, {
  cwd: '/path/to/project',
  path: '/ws',
  getCommandAndArgs: (searchParams) => ({
    command: 'claude',
    args: [],
  }),
  onSessionCreated: ({ pid, searchParams }) => {
    console.log(`PTY started: pid=${pid}`);
  },
});

server.listen(3000);

// Cleanup:
// await chat.close();

createChatServer(server, options) returns { wss, sessions, close }.

Server Options

| Option | Description | |---|---| | cwd | Working directory for the terminal | | path | WebSocket endpoint path | | getCommandAndArgs(searchParams) | Callback that receives URL query parameters (URLSearchParams) and returns { command, args }. If omitted, $SHELL is launched | | onSessionCreated({ pid, searchParams }) | Callback invoked after the PTY process starts. Receives the process ID and URL query parameters |

Library Usage (Client)

<div id="terminal"></div>
<script src="/node_modules/embed-terminal/src/client.js"></script>
<script>
  const term = new ChatTerminal(document.getElementById('terminal'), {
    wsUrl: 'ws://localhost:3000/ws',
    fontSize: 14,
    theme: 'dark',
  });

  term.onExit = function (event) {
    console.log('exited with code', event.code);
  };
</script>

Client Options

| Option | Default | Description | |---|---|---| | wsUrl | auto-detected | WebSocket URL | | fontSize | 14 | Terminal font size | | fontFamily | "JetBrains Mono", monospace | Terminal font | | theme | 'default' | Theme name or custom object |

Client Methods

  • connect() — connect to the server
  • dispose() — close connection and clean up
  • fit() — resize terminal to fit container
  • resize(cols, rows) — set explicit terminal size
  • sendInput(text) — send text to the PTY
  • setFontSize(size) — change font size
  • setTheme(theme) — change theme (name or object)
  • setInputTransformer(fn) — transform input before sending

Mobile Support

On screens narrower than 768px, a control bar is automatically displayed at the bottom of the terminal.

Available buttons: Ctrl, Shift, Tab, Esc, Enter, ↑↓←→ (arrow keys)

Lock mode: Double-tap a modifier button (Ctrl, Shift) to lock it on. Tap again to unlock.

Mobile control bar

Requirements

  • Node.js 18+

License

MIT