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

@okhsunrog/svg-term-cli

v2.1.1

Published

Share terminal sessions as razor-sharp animated SVG everywhere

Readme

Share terminal sessions as razor-sharp animated SVG everywhere

Example generated with svg-term --cast 113643 --out examples/parrot.svg --window --no-cursor --from=4500

svg-term-cli

  • 💄 Render asciicast to animated SVG
  • 🌐 Share asciicasts everywhere (sans JS)
  • 🤖 Style with common color profiles

Maintenance note: This CLI is a maintained fork of marionebl/svg-term-cli. The underlying renderer uses a maintained fork of svg-term: okhsunrog/svg-term.

Install

  1. Install asciinema via: https://asciinema.org/docs/installation

  2. Install @okhsunrog/svg-term-cli (this maintained fork):

    # npm (global)
    npm install -g @okhsunrog/svg-term-cli
    
    # OR
    
    # Bun (global)
    bun add -g @okhsunrog/svg-term-cli

    Note: If you previously installed the original package name globally, uninstall it first to avoid PATH conflicts:

    npm uninstall -g svg-term-cli || true
    bun remove -g svg-term-cli || true

Requirements

  • Node.js >= 18 (ESM)
  • For local development/build: Bun >= 1.0

Usage

Generate the parrot.svg example from asciicast at https://asciinema.org/a/113643

svg-term --cast=113643 --out examples/parrot.svg --window

Optimization

SVG output is optimized by default using SVGO. You can control optimization and size with the following flags:

  • --no-optimize: disable SVGO optimization (default is optimized)
  • --window: include window chrome; omit for smaller output
  • --padding, --padding-x, --padding-y: reduce padding to shrink the canvas, e.g. --padding 0
  • --at <ms>: render a single frame (static preview) instead of the full animation
  • --from <ms> / --to <ms>: trim the animation to a time range

Examples:

# Optimized animated SVG (default optimization)
svg-term --in rec.cast --out examples/archinstall-zfs.svg --window

# Unoptimized output (bigger)
svg-term --in rec.cast --out examples/unoptimized.svg --window --no-optimize

# Smallest static preview: no window, no padding, single frame
svg-term --in rec.cast --out examples/preview.svg --at 4500 --padding 0

Development

This repo uses Bun for tooling.

# install deps
bun install

# type-check + build to lib/
bun run build

# run tests
bun test

Interface

λ svg-term --help

  Share terminal sessions as razor-sharp animated SVG everywhere

  Usage
    $ svg-term [options]

  Options
    --at            timestamp of frame to render in ms [number]
    --cast          asciinema cast id to download [string], required if no stdin provided [string]
    --command       command to record [string]
    --from          lower range of timeline to render in ms [number]
    --height        height in lines [number]
    --help          print this help [boolean]
    --in            json file to use as input [string]
    --no-cursor     disable cursor rendering [boolean]
    --no-optimize   disable svgo optimization [boolean]
    --out           output file, emits to stdout if omitted, [string]
    --padding       distance between text and image bounds, [number]
    --padding-x     distance between text and image bounds on x axis [number]
    --padding-y     distance between text and image bounds on y axis [number]
    --profile       terminal profile file to use, requires --term [string]
    --term          terminal profile format [iterm2, xrdb, xresources, terminator, konsole, terminal, remmina, termite, tilda, xcfe], requires --profile [string]
    --to            upper range of timeline to render in ms [number]
    --width         width in columns [number]
    --window        render with window decorations [boolean]

  Examples
    $ cat rec.json | svg-term
    $ svg-term --cast 113643
    $ svg-term --cast 113643 --out examples/parrot.svg

Rationale

Replace GIF asciicast recordings where you can not use the asciinema player, e.g. README.md files on GitHub and the npm registry.

The image at the top of this README is an example. See how sharp the text looks, even when you zoom in? That’s because it’s an SVG!

Related

Differences from upstream

Compared to the original projects:

Changes in this CLI:

  • Migrated to Bun for tooling (install/build/test) and TypeScript 5
  • Switched to ESM (NodeNext) and modern tsconfig
  • Replaced Jest + ts-jest with Bun’s test runner
  • Updated dependencies: meow@^13, chalk@^5, execa@^9, svgo@^4, plist@^3, get-stdin@^9, tempy@^3
  • Removed legacy/unused deps and old type packages
  • CLI help/flags updated; optimization flags documented; example SVGs refreshed

Changes in the renderer fork (okhsunrog/svg-term):

  • Migrated to ESM and Bun tooling; added types entry
  • Updated React to 19 and Emotion to 11 (@emotion/react, @emotion/styled)
  • Fixed React key warnings in frame word rendering
  • Kept public render(input, options) API compatible with upstream

These updates modernize the stack while preserving the core behavior and interface of the original tools.

Gallery

License

Copyright 2025. Released under the MIT license.