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

termsnapshot

v1.0.1

Published

Record terminal sessions as shareable JSON files that replay anywhere — no vendor lock-in

Downloads

17

Readme

TermSnapshot

Record terminal sessions as shareable JSON — replay anywhere, no vendor lock-in

npm version License: MIT

TermSnapshot records your terminal sessions into plain JSON files. No proprietary format, no account, no player to install. Share a .termsnapshot.json file and anyone can replay it in seconds.

# Install
npm install -g termsnapshot

# Record a session
termsnapshot record -o my-session.termsnapshot.json

# Replay in terminal
termsnapshot play my-session.termsnapshot.json

# Export to a standalone HTML page (open in any browser)
termsnapshot export my-session.termsnapshot.json -o replay.html

Why TermSnapshot?

| | TermSnapshot | asciinema | |---|---|---| | File format | Plain JSON | .cast (binary-ish) | | Replay without tool | ❌ — needs asciinema player | ❌ — needs asciinema player | | Export to HTML | ✅ Native | ❌ No | | Browser replay | ✅ Any browser, self-contained HTML | ❌ No | | Git-friendly | ✅ Yes | ⚠️ Large files | | No account needed | ✅ Yes | ❌ Requires asciinema.org |

Features

  • Record — Spawns a real PTY and captures all output + input with precise timestamps
  • Replay — Plays back session in your terminal with configurable speed
  • Export — Generates a fully self-contained HTML page with an interactive player
  • Inspectinfo command shows session metadata without playing
  • Plain JSON — Session files are just JSON. Parse them anywhere. Build your own tooling.

Installation

Via npm (recommended)

npm install -g termsnapshot

Via npx (no install)

npx termsnapshot record -o demo.termsnapshot.json

From source

git clone https://github.com/YOUR_USERNAME/termsnapshot.git
cd termsnapshot
npm install
npm run build
npm link

Quick Start

# Record
termsnapshot record -o demo.termsnapshot.json

# Replay
termsnapshot play demo.termsnapshot.json --speed 2.0

# Export HTML
termsnapshot export demo.termsnapshot.json -o demo.html

# Inspect
termsnapshot info demo.termsnapshot.json

Session File Format

Session files are plain JSON:

{
  "version": "1.0.0",
  "title": "Deploying my app",
  "createdAt": "2026-04-10T00:00:00.000Z",
  "shell": "bash",
  "terminal": { "cols": 80, "rows": 24 },
  "events": [
    { "type": "output", "ts": 0,    "data": "user@host:~$ " },
    { "type": "input",  "ts": 120,  "data": "git push\n" },
    { "type": "output", "ts": 135,  "data": "Enumerating objects: 100%\n" }
  ],
  "exitCode": 0,
  "duration": 5420
}

Event types:

  • output — Terminal output (stdout + stderr)
  • input — User keyboard input
  • resize — Terminal resize events
  • info — Metadata events (cwd, env, etc.)

HTML Export

The exported HTML file is fully self-contained — no external dependencies, no CDN, no tracking. It embeds:

  • ANSI escape sequence rendering (colors, bold, etc.)
  • Interactive playback controls (play, pause, reset)
  • Scrub-able progress bar
  • Auto-play on load
  • Dark/light theme support

Open the HTML file directly in any browser. Share it anywhere.

CLI Reference

termsnapshot <command> [options]

Commands:
  record           Start recording a new terminal session
  play <file>      Replay a session from a JSON file
  export <file>    Export a session to a standalone HTML page
  info <file>       Show info about a session file
  (default)        Start recording (shorthand for `record`)

Global Options:
  -h, --help       Show help
  -v, --version    Show version

Record Options:
  -o, --output <path>   Output file path  (default: session.termsnapshot.json)
  -t, --title <title>   Session title      (default: Untitled Session)
  -s, --shell <shell>   Shell to spawn     (default: bash)

Play Options:
  -s, --speed <scale>   Playback speed multiplier (default: 1.0)

Export Options:
  -o, --output <path>   Output HTML path  (default: session_replay.html)
  -t, --title <title>   Page title         (default: TermSnapshot Replay)

Architecture

src/
  cli.ts            # Commander.js entry point
  commands/
    record.ts       # PTY recording logic
    play.ts         # Terminal replay
    export.ts       # HTML export
    info.ts         # Session info
  lib/
    pty.ts          # node-pty wrapper (PtyRecorder)
    session.ts      # Session type definitions
    renderer.ts     # HTML renderer for exports
    version.ts      # Version constant

Building

npm install
npm run build     # TypeScript → dist/
npm test          # Run test suite

Contributing

Contributions are welcome! Please open an issue first to discuss any non-trivial changes.

License

MIT © 2026