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

react-terminal-404

v0.1.1

Published

Drop-in terminal-style 404 page for React. Virtual filesystem, fake apt install, kernel-panic destruct animation, zero config.

Readme

react-terminal-404

Drop-in terminal-style 404 page for React. Virtual filesystem, fake apt install, kernel-panic destruct animation. Zero config.

→ Try the live demo

react-terminal-404 in action

Why

Most 404 pages are a dead end. This one lets the user poke around — ls, cd, mkdir, cat, apt install, the works — while they figure out where they meant to go. Drop it in your router's catch-all and forget about it.

Install

npm install react-terminal-404

Peer deps: react >= 17, react-dom >= 17. Works with Next.js App Router ("use client" is preserved in the build).

Usage

import { Terminal404 } from 'react-terminal-404';

export default function NotFoundPage() {
  return <Terminal404 />;
}

That's it. No CSS imports, no setup. The component reads window.location.pathname to show what was missing, and clicking home → (or typing home / exit) navigates to /.

React Router

import { createBrowserRouter } from 'react-router-dom';
import { Terminal404 } from 'react-terminal-404';

const router = createBrowserRouter([
  // …your routes…
  { path: '*', element: <Terminal404 /> },
]);

Next.js (App Router)

// app/not-found.tsx
import { Terminal404 } from 'react-terminal-404';

export default function NotFound() {
  return <Terminal404 />;
}

Custom navigation

If you want to use your router's navigation instead of window.location.assign:

import { useNavigate } from 'react-router-dom';
import { Terminal404 } from 'react-terminal-404';

export default function NotFoundPage() {
  const navigate = useNavigate();
  return <Terminal404 onNavigateHome={() => navigate('/')} />;
}

What works in the terminal

| Command | Behavior | |---|---| | help, ? | List commands | | ls, cd, pwd, mkdir, touch, cat, rm [-rf] | Real virtual filesystem | | echo foo > file, echo foo >> file | Write / append | | clear (or Ctrl+L) | Wipe screen | | history, whoami, date | Basics | | apt install <pkg>, npm install, yarn add | Fake progress bar | | sudo <anything> | "you are already root. behave." | | sudo rm -rf / | Full kernel-panic destruct sequence | | vim, nano, emacs | Editor war jokes | | git commit/push/status | Dry humor | | make coffee | 418 | | fortune, cowsay <msg> | Classics | | home, exit, quit | Navigate back |

UX details: ↑/↓ arrows scroll command history. Ctrl+C cancels current line. Click anywhere to refocus the input.

Props

interface Terminal404Props {
  /** Path that "doesn't exist" — shown as the boot `cd …` failure. Defaults to window.location.pathname. */
  pathname?: string;
  /** Prompt user/host. Defaults to root@localhost. */
  prompt?: { user?: string; host?: string };
  /** Called when the user types `home` / `exit` or clicks the home button. Defaults to `window.location.assign('/')`. */
  onNavigateHome?: () => void;
  /** Show the top-right home button. Default true. */
  homeButton?: boolean;
  /** Override the boot banner shown above the failed `cd`. */
  bootMessage?: string;
  /** Enable the kernel-panic destruct sequence on `rm -rf /`. Default true. */
  heartAttack?: boolean;
  /** Optional className applied to the outer wrapper. */
  className?: string;
}

Examples

// Branded prompt
<Terminal404 prompt={{ user: 'you', host: 'acme.dev' }} />

// Custom boot banner
<Terminal404 bootMessage="acme.dev terminal · build 42 (it's all fine)" />

// Disable the destruct animation (some users do not enjoy a 2.5-second blackout)
<Terminal404 heartAttack={false} />

// Hide the home button (e.g., if your layout has its own escape hatch)
<Terminal404 homeButton={false} />

What this is not

  • Not a real terminal emulator. Use @xterm/xterm for that.
  • Not a generic terminal-emulator React component. Use react-console-emulator if you want to wire your own commands from scratch.
  • Not customizable beyond the props above (yet). Custom user-defined commands are planned for 0.2.

This package is opinionated about being a 404 page. The commands, jokes, and animations are batteries-included.

Versioning

0.x while the API is in flux. After 1.0, semver as usual.

License

MIT © Amimul Ehshan