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

astrashell

v1.0.1

Published

A POSIX-style command-line shell written from scratch in Node.js — supports pipelines, I/O redirection, background jobs, command history, and tab completion.

Readme

AstraShell

A POSIX-style command-line shell built in Node.js. It parses and executes commands the way a real shell does — running external programs, handling pipelines and I/O redirection, managing background jobs, and providing an interactive REPL with tab completion and command history.

Development Status

AstraShell is an actively maintained project in early development.

The core shell is functional, and development is ongoing with a focus on stability, POSIX compatibility, performance, and improving the overall interactive experience.

What's being improved

  • Command parsing and execution
  • Pipelines and I/O redirection
  • Background job handling
  • History and tab completion
  • Error handling and edge cases
  • POSIX compatibility
  • Test coverage and documentation

The API and behavior may evolve as the project matures. Contributions, feedback, and bug reports are welcome.

Features

  • Command execution — resolves external programs via PATH and runs them with proper argument handling and quoting (single quotes, double quotes, and escape sequences).

  • Builtins — cd, pwd, echo, type, exit, history, jobs, declare, and complete.

  • Pipelines — chain commands with |, including select builtins (echo, pwd, cd, type) as pipeline stages, by re-invoking the shell as a subprocess so builtin output lands on the correct pipe.

  • I/O redirection — >, >>, 2>, 2>>, with stdout and stderr each redirectable to independent targets.

  • Background jobs — run commands with a trailing &, track them in a job table, and list them with jobs.

  • Command history — in-memory history with history, plus HISTFILE support (history -r to load, -w to write, -a to append only new entries since the last write).

  • Tab completion — completes builtin names and executables on PATH, completes filenames/directories for arguments, supports the classic "ring bell, then list all matches on second Tab" behavior, and can delegate to custom completion scripts registered via complete -C.

  • Shell variables — declare NAME=VALUE with identifier validation.

Running it

Requires Node.js (v20+ recommended).

./run.sh

or

npm start

This drops you into an interactive prompt:

$ echo hello | tr a-z A-Z
HELLO

$ ls -la > out.txt

$ jobs

$ history

Project Structure

app/
  main.js    # shell REPL, parser, builtins, job control, tab completion
run.sh       # convenience script to run the shell locally

Design Notes

  • The parser tokenizes commands respecting single/double quotes and backslash escapes before dispatching to builtins or external processes.
  • Builtins that need to act as pipeline stages are re-invoked as a subprocess (node app/main.js --run-builtin ...) so their stdout/stderr can be wired directly into the pipe between commands, rather than threading raw file descriptors through in-process builtin logic.
  • Background job numbers are reused once every prior job has been reaped, matching how real shells number jobs.
  • Tab-completion state (last completed line, repeated-Tab count) is tracked across calls so the shell can distinguish a first Tab press (bell) from a second (list all matches), the same way bash does.