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

piet-interpreter-js

v0.5.1

Published

piet interpreter for JavaScript

Readme

piet-interpreter-js

To install

npm install piet-interpretter-js

To use:

Import the library

import Interpreter from 'piet-interpreter-js'

Collect the program as a 2d Array:

// notes for the shortcut color names are in the Constants file
const SRC = [
    ['mr','mr','dr','wh','wh','wh','mg','dm','wh'],
    ['mr','mr','wh','wh','wh','wh','wh','wh','wh'],
    ['mr','wh','bl','wh','wh','wh','wh','wh','wh'],
    ['wh','bl','mg','bl','wh','wh','wh','mr','mr'],
    ['wh','bl','mg','wh','wh','lm','dr','mr','mr'],
    ['wh','bl','mg','bl','wh','wh','wh','bl','wh'],
    ['wh','wh','bl','wh','wh','wh','wh','wh','wh']
]

const INTERPRETER = new Interpreter(SRC)

while(!INTERPRETTER.halt) {
    const RESPONSE = INTERPRETTER.step()
    
    // do your piet work
}

After running the step() method you'll have access to the stack, direction and codel pointer, the previous color, the next operation point, and whether the Interpreter is outputting or requiring IO actions.

On every step the Interpretter returns a response object. This object always has a halt property, and when the program has fully executed, that property will be true.

Always check for IO obligations in the response object. prompt will contain a function if it needs to be furfilled, and type will be set to either 'Char' or 'Number', depending on what the source has asked for. Calling step before executing the prompt method will result in an Error being thrown. As well, the output property will hold any program output if it exists. output with either be empty or replaced upon the next execution of step. You are not required to consume the output.

Currently, the response object does not hold all of the information that the Interpreter Class can provide, so feel free to access the class directly if you require more information from the interpreter, as well though, expect the Response object to widen/become more detailed as the project continues.

For information on the Piet Language, reference DangerMouse.net and follow every link you find.

TODO

  • Commandline interface
  • Read a number of inputs: .json, .jpeg, .gif, etc. (Will likely be published as plugins)
  • setUp method that allows passing of different specs (Piet spec is currently inspecific and Interpreter to Interpreter)