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

@sfotty-pie/cli

v0.1.0

Published

An emulator for a hypothetical 6502 system for writing CLI programs

Downloads

2

Readme

Sfotty Pie CLI

Sfotty Pie CLI is an emulator for a virtual 6502-based computer. The current implementation allows you two write CLI programs with access to stdin, stdout, and stderr.

Executable file format

| Offset | Size | Description | | ------ | -------- | ----------------------------------------- | | 0x0000 | 0x06 | Magic number (The word SFOTTY in ASCII) | | 0x0006 | 0x04 | Reserved (must be zero) | | 0x000A | 0x06 | Interrupt vectors | | 0x0010 | variable | Program contents |

System documentation

The interrupt vectors are the NMI, reset, and IRQ vectors, in that order. They are loaded starting from the address $FFFA. The NMI and IRQ vectors are currently unused and should be set to 0. The reset vector at $FFFC is the main program entry.

The program contents are loaded starting from the address $0400.

Page 2 (addresses from $0200 to $02FF) is reserved for I/O operations. Currently, the following I/O operations are defined:

| Address | Name | Read / Write | Description | | ------- | -------- | ------------ | ------------------------------------------------------------- | | $0200 | EXIT | W | Any write here exists the program with the written exit code. | | $0201 | STDIN | R | Read a byte from the standard input (blocking). | | $0202 | STDOUT | W | Write a byte to the standard output. | | $0203 | STDERR | W | Write a byte to the standard error. | | $0240 | RAND | R | Read a random byte. | | $0241 | FSTIN | R | Status of stdin: EOF if bit 7 set. |

On program start, all CPU registers will be in an unknown state. In particular, you should remember to clear the decimal flag. page 3 (addresses from $0300 to $03FF) will contain the command line arguments as a null-terminated list of null-terminated strings.

Everything other than the I/O area is RAM, including the command line argument area, the program contents, and the interrupt vectors. Free areas will contain all zeroes.

Executing an undocumented opcode ends the program with exit code 2.

Sample programs

Executables for the sample programs are in the samples directory. The sources are available in src/samples. You need the ca65 assembler from the cc65 package to build them.

| Name | Description | | ------- | --------------------------------- | | hello | Prints "Hello, world!" to stdout. | | cat | Reads stdin and writes to stdout. | | echo | Prints the arguments to stdout. | | guess | Guess the number game. |

Ideas for future versions

  • Provide a lib6502 implementation (file I/O and more)
  • Provide a cc65 library implementation