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

nanoterm

v0.4.0

Published

pluggable unix emulator for the browser

Readme

nanoterm

tiny unix in the browser

ezgif-32cea9241ed81b54

  • built on xterm.js
  • use as a library from TS/JS
  • pluggable shell (uses nash by default)
  • built-in virtual filesystem plus overlays
  • custom commands, configurable styling, tree-shakable
npm install nanoterm
import { createNanoTerm } from 'nanoterm';

createNanoTerm(document.getElementById('terminal')!);

By default this uses the built-in in-memory filesystem. This can be changed to instead use localStorage for client-side persistence.

Styling:

import { createNanoTerm } from 'nanoterm';

createNanoTerm(document.getElementById('terminal')!, {
  terminal: {
    fontSize: 16,
    cursorBlink: false,
    theme: {
      background: '#101418',
      foreground: '#e6edf3',
      green: '#7ee787',
    },
  },
});

Commands:

import { createNanoTerm, registry } from 'nanoterm';

registry.register({
  name: 'rev',
  description: 'reverse a string',
  usage: 'rev <text>',
  handler: (ctx) => (ctx.writeStdout(`${ctx.args.join(' ').split('').reverse().join('')}\r\n`), { exitCode: 0 }),
});

createNanoTerm(document.getElementById('terminal')!);
rev nanoterm
mretonan

Filesystem:

Nanoterm boots a virtual Unix-like filesystem. If you want to add a few files, think overlay. If you want a completely different machine, point the overlay builder at another directory and use that as the bundle.

Appending a few files:

{
  "/": {
    "home": {
      "guest": {
        "notes.txt": "hello"
      }
    }
  }
}

Building an overlay from a directory:

node scripts/build-overlay.mjs --fromDir ./overlay --out ./src/generated/fs-overlay.json

Docker's overlay model is a reasonable mental model here, especially if you just want to append or replace paths.

Overlay format:

{
  "/": {
    "etc": {
      "message.txt": "hello",
      "config.json": { "theme": "dark" },
      "logo.bin": "YWJj"
    }
  },
  "_": {
    "types": {
      "/": {
        "etc": {
          "config.json": "json",
          "logo.bin": "base64"
        }
      }
    },
    "ops": [
      { "-": "examples/" },
      { "+": "examples/basic" }
    ]
  }
}
  • by default ~/.nashrc is run at startup.
  • "/" is the filesystem root
  • strings are text files by default
  • plain objects are directories by default
  • _.types is only for exceptions such as json and base64
  • _.ops filters which parts of the overlay should be visible

Overlays can also be applied at runtime:

import { applyFSOverlay, parseOverlayJson } from 'nanoterm';

const overlay = parseOverlayJson(rawOverlayJson);
applyFSOverlay(myFilesystem, overlay);

The built-in snapshot command prints a link that uses this same ?overlay=... mechanism.

If you want the walked files instead:

import { forEachOverlayFile, parseOverlayJson } from 'nanoterm';

const overlay = parseOverlayJson(rawOverlayJson);

forEachOverlayFile(overlay, (path, content) => {
  console.log(path, content);
});

Built-in commands:

ascii
cat
cd
chmod
clear
cp
curl
date
echo
emoji
env
export
grep
head
help
history
infomsg
jq
ls
mkdir
motd
mv
nano
pwd
readvar
rm
snapshot
sleep
tail
touch
tree
uname
wget
whoami
wc

nash

The default shell is nash. It supports variable expansion, NAME=value assignment, &&, and stdout redirects (> / >>). It does not currently support pipes, ||, subshells, globbing, or stdin/stderr redirects.

The JS code for the shell interpreter is generated from the OCaml spec in nash.