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

heyhoy

v0.5.0

Published

(WIP - Experimental) Damn simple programming language built using javascript from scratch (no jison, no bison).

Readme

HEYHOY!

Damn simple programming language built using javascript from scratch (no jison, no bison).

This project was created to help me studying recursive-descent top-down parser implementation.

| Branch | Status | | - | - | | master | Build Status | | develop | Build Status |

Usage

First, import the module:

const heyhoy = require('heyhoy');

Basic calculation:

const code1 = `
width = 50
length = 100
height = 20

area = width * length + length * height + width * height
area = 2 * area

return area
`;

console.log('The surface area of the cuboid is ' + heyhoy(code1));
// The surface area of the cuboid is 16000

Printing value example:

const code2 = `
x = 10
print x
x = x + 20
print x
`;

heyhoy(code2);
// 10
// 30

Language Grammar

Lexemes and Tokens

=           EQ_SIGN
*           MUL_SIGN
+           ADD_SIGN
[0-9]+      NUMBER
[a-z]+      IDENTIFIER
\n          NEW_LINE

Backus-Naur Form

<program> -> <statement> <program>
        | <statement> 
        | EOF

<statement> -> IDENTIFIER '=' <expression> NEW_LINE     // Assign
        | IDENTIFIER IDENTIFIER                         // Function, can only take one argument
        | NEW_LINE

<expression> -> <expression> { '+' <expression> }

<factor> -> <factor> { '*' <term> }

<term> -> NUMBER
        | IDENTIFIER

Yes, currently this language currently only supports multiplication and addition on integer. 😅 Might be expanded further sometime...

Show Abstract Syntax Tree

const code3 = `
x = 1
y = 2
z = x * y
`;

// Put true at the second parameter for verbose
heyhoy(code3, true);

AST

Start HEYHOY!
Inputted code:

x = 1
y = 2
z = x * y

Tokens & Lexemes
[
  [ 2, '\n' ], [ 0, 'x' ],
  [ 11, '=' ], [ 1, '1' ],
  [ 2, '\n' ], [ 0, 'y' ],
  [ 11, '=' ], [ 1, '2' ],
  [ 2, '\n' ], [ 0, 'z' ],
  [ 11, '=' ], [ 0, 'x' ],
  [ 12, '*' ], [ 0, 'y' ],
  [ 2, '\n' ], [ 14, '' ]
]
Parse tree
Initial Lex --->  [ 2, '\n' ]
 Enter Program
    Enter Statement
    Exit Statement
    Call lex [ 0, 'x' ]
    Enter Program
       Enter Statement
          Call lex [ 11, '=' ]
          Call lex [ 1, '1' ]
          Enter Expression
             Enter Factor
                Enter Term
                   Call lex [ 2, '\n' ]
                Exit Term
             Exit Factor
          Exit Expression
          Storing variable -->  x = 1
          Current variables -->  { x: 1 }
       Exit Statement
       Call lex [ 0, 'y' ]
       Enter Program
          Enter Statement
             Call lex [ 11, '=' ]
             Call lex [ 1, '2' ]
             Enter Expression
                Enter Factor
                   Enter Term
                      Call lex [ 2, '\n' ]
                   Exit Term
                Exit Factor
             Exit Expression
             Storing variable -->  y = 2
             Current variables -->  { x: 1, y: 2 }
          Exit Statement
          Call lex [ 0, 'z' ]
          Enter Program
             Enter Statement
                Call lex [ 11, '=' ]
                Call lex [ 0, 'x' ]
                Enter Expression
                   Enter Factor
                      Enter Term
                         Call lex [ 12, '*' ]
                      Exit Term
                      Call lex [ 0, 'y' ]
                      Enter Factor
                         Enter Term
                            Call lex [ 2, '\n' ]
                         Exit Term
                      Exit Factor
                   Exit Factor
                Exit Expression
                Storing variable -->  z = 2
                Current variables -->  { x: 1, y: 2, z: 2 }
             Exit Statement
             Call lex [ 14, '' ]
             Enter Program
                Bye!
             Exit Program
          Exit Program
       Exit Program
    Exit Program
 Exit Program

License

Copyright 2019 Ezzat Chamudi

Licensed under the Apache-2.0.