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

retro-dos-terminal

v0.1.0

Published

DOS-style terminal emulator for React. Because not everything needs to be Unix.

Readme

retro-dos-terminal

DOS-style terminal emulator for React. Because not everything needs to be Unix.

Features

  • Authentic DOS look and feel with bundled VGA font
  • Plugin architecture for commands, filesystem, and effects
  • Theme support (DOS gray, phosphor green, phosphor amber)
  • Virtual filesystem with DIR, CD, TYPE commands
  • DOSKEY-style command history (up/down arrows)
  • Optional CRT effects (scanlines, glow, flicker)
  • BIOS boot screen simulation
  • Tree-shakeable - only bundle what you use

Installation

npm install retro-dos-terminal

Quick Start

import { Terminal } from 'retro-dos-terminal'
import { commands } from 'retro-dos-terminal/plugins/commands'
import { filesystem } from 'retro-dos-terminal/plugins/filesystem'
import 'retro-dos-terminal/styles.css'

const files = {
  'C:\\': {
    'README.TXT': 'Welcome to my terminal!',
    'PROGRAMS': {
      'HELLO.EXE': '[executable]',
    },
  },
}

function App() {
  return (
    <Terminal
      theme="phosphor-green"
      plugins={[
        filesystem({ files }),
        commands(),
      ]}
      welcomeMessage={[
        'Welcome to DOS Terminal',
        'Type HELP for available commands.',
      ]}
    />
  )
}

Themes

Three built-in themes:

// Classic DOS gray
<Terminal theme="dos" />

// Green phosphor (default)
<Terminal theme="phosphor-green" />

// Amber phosphor
<Terminal theme="phosphor-amber" />

// Custom theme
<Terminal theme={{
  background: '#1a1a2e',
  text: '#00ff88',
  prompt: '#00ff88',
  command: '#ffffff',
}} />

Plugins

Commands Plugin

Provides built-in DOS commands:

import { commands } from 'retro-dos-terminal/plugins/commands'

<Terminal plugins={[commands()]} />

Built-in commands: CLS, DIR, CD, TYPE, ECHO, VER, HELP, EXIT

Filesystem Plugin

Virtual filesystem for DIR, CD, TYPE:

import { filesystem } from 'retro-dos-terminal/plugins/filesystem'

const files = {
  'C:\\': {
    'AUTOEXEC.BAT': '@echo off',
    'CONFIG.SYS': 'FILES=40',
    'DOS': {
      'COMMAND.COM': '[system]',
    },
  },
}

<Terminal plugins={[filesystem({ files })]} />

DOSKEY Plugin

Command history with arrow keys:

import { doskey } from 'retro-dos-terminal/plugins/doskey'

<Terminal plugins={[doskey({ maxHistory: 50 })]} />

CRT Effects Plugin

Retro CRT monitor effects:

import { crt } from 'retro-dos-terminal/plugins/effects'
import 'retro-dos-terminal/plugins/effects/styles.css'

<Terminal plugins={[crt({
  scanlines: true,
  scanlineOpacity: 0.1,
  glow: true,
  glowIntensity: 0.4,
  flicker: false,
})]} />

Programs Plugin

Run interactive programs:

import { programs, type TerminalProgram } from 'retro-dos-terminal/plugins/programs'

const myProgram: TerminalProgram = {
  name: 'hello',
  run: async (ctx) => {
    ctx.print('Hello, World!')
    ctx.print('Press any key to exit...')
    await ctx.waitForKey()
  },
}

<Terminal plugins={[programs({ programs: [myProgram] })]} />

BIOS Boot Screen

Optional retro BIOS POST screen:

import { BIOSBoot } from 'retro-dos-terminal/boot'

<BIOSBoot
  preset="award"  // 'award', 'ami', or 'phoenix'
  speed="fast"    // 'instant', 'fast', or 'authentic'
  onComplete={() => console.log('Boot complete!')}
>
  <Terminal ... />
</BIOSBoot>

// Custom BIOS configuration
<BIOSBoot
  biosName="MyOS BIOS"
  biosVersion="v1.0"
  cpu="Intel Pentium 133MHz"
  memory={640}
  drives={{ primaryMaster: 'QUANTUM FIREBALL 540MB' }}
>
  <Terminal ... />
</BIOSBoot>

Imperative Handle

Control the terminal programmatically:

import { useRef } from 'react'
import { Terminal, type TerminalHandle } from 'retro-dos-terminal'

function App() {
  const terminalRef = useRef<TerminalHandle>(null)

  const runCommand = () => {
    terminalRef.current?.executeCommand('DIR')
  }

  return (
    <>
      <button onClick={runCommand}>Run DIR</button>
      <Terminal ref={terminalRef} />
    </>
  )
}

Available methods:

  • print(text) - Print output lines
  • printError(text) - Print error lines
  • clear() - Clear the screen
  • focus() - Focus the input
  • executeCommand(cmd) - Execute a command

DOS Preset

For a quick DOS-like setup with all plugins:

import { DOSTerminal } from 'retro-dos-terminal/presets/dos'

<DOSTerminal
  filesystem={files}
  programs={[myProgram]}
  crt={{ scanlines: true }}
  onExit={() => console.log('Goodbye!')}
/>

TypeScript

Full TypeScript support with exported types:

import type {
  TerminalProps,
  TerminalHandle,
  TerminalPlugin,
  TerminalContext,
  TerminalProgram,
  CommandHandler,
  CommandResult,
} from 'retro-dos-terminal'

Browser Support

Works in all modern browsers. The bundled DOS VGA font provides authentic rendering.

License

MIT