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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@arcblock/terminal

v3.3.0

Published

A react wrapper for xterm allowing you to easily render a terminal in the browser

Readme

@arcblock/terminal

Terminal Player is a React component for playing back terminal recordings in the browser, built on top of xterm.js. Perfect for creating interactive terminal demos, tutorials, and documentation.

Features

  • 🎬 Playback Controls: Play, pause, seek, and loop terminal recordings
  • 🎨 Customizable Themes: Full terminal color theme support
  • 📱 Responsive Design: Automatically adapts to container size
  • Performance: Optimized for smooth playback of long recordings
  • 🔧 Easy Integration: Simple React component API
  • 📹 asciinema Compatible: Works with standard .cast recording format

Installation

yarn add @arcblock/terminal

Quick Start

Basic Usage

import { Player } from '@arcblock/terminal';
import recordingData from './my-recording.json';

export default function Demo() {
  return <Player frames={recordingData.records} options={recordingData.config} loop={true} />;
}

Player Props

| Prop | Type | Default | Description | | ------------ | ---------- | ------------ | -------------------------------- | | frames | Array | required | Array of terminal frames to play | | options | Object | required | Player configuration and theme | | onStart | Function | - | Callback when playback starts | | onPause | Function | - | Callback when playback pauses | | onComplete | Function | - | Callback when playback completes |

Recording Terminal Sessions

1. Install asciinema

# macOS
brew install asciinema

# Ubuntu/Debian
sudo apt install asciinema

# pip
pipx install asciinema

2. Record Your Session

# Start recording
asciinema rec my-demo.cast

# ... perform your terminal commands ...

# Stop recording (Ctrl+D or type 'exit')

3. Convert to Player Format

Visit our online converter to transform your .cast file:

👉 https://arcblock.github.io/ux/?path=/story/data-display-terminal-player--recording-guide

  • Drag & drop your .cast file
  • Instant conversion and live preview
  • Download the converted JSON file
  • No command-line tools required!

Advanced Configuration

Custom Theme

const customOptions = {
  ...recordingData.config,
  theme: {
    background: '#1e1e1e',
    foreground: '#d4d4d4',
    cursor: '#ffffff',
    // ... more colors
  },
};

<Player frames={frames} options={customOptions} />;

Playback Options

const playbackOptions = {
  ...recordingData.config,
  frameDelay: 'auto', // or number in ms
  maxIdleTime: 2000, // max delay between frames
  repeat: true, // loop playback
  autoplay: true, // start automatically
};

Examples

Check out our Storybook demos:

Data Format

The Player expects data in this format:

{
  "config": {
    "cols": 80,
    "rows": 24,
    "frameDelay": "auto",
    "theme": {
      /* terminal colors */
    }
  },
  "records": [
    { "delay": 100, "content": "Hello World!\n" },
    { "delay": 500, "content": "Next command...\n" }
  ]
}

License

Apache 2.0