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

jellymarker

v0.8.3

Published

Jellymarker.js defines a set of simple rules for expressions (i.e, +, -, *, /, (), call).

Downloads

6

Readme

Jellymarker.js

Jellymarker.js defines a set of simple rules for expressions (i.e, +, -, *, /, (), call).

Data and operations are all abstracted and you need to define your own.

A simple demo:

First you defined variable A and B:

var Jellymarker  = require('jellymarker');

var jellymarker = Jellymarker.create();

jellymarker.registerVariables('A', {v:'Hi'})

jellymarker.registerVariables('B', {v:'Bob'})

Then you defined operator + * - :

jellymarker.registerOperators('+', function(v1, v2) {
    return {
        v: v1.v + ' ' + v2.v
    }
})

Apply the rule with Jellymarker:

C = A + B

console.log(jellymarker.eval('C = A + B'))

Finally you get C:

{
    v: 'Hi Bob'
}

Installation

git clone https://github.com/w-y/jellymarker.git

cd jellymarker

npm install

node ./bin/build.js  // ./dist/jellymarker.js

Variables

Define a named data structure:

jellymarker.registerVariables('EMPTY', {})

Then you can use it in the script as

EMPTY

It could be a function:

jellymarker.registerVariables('NOP', function() {})

And in the script:

NOP()

Obviously, the operations between variables could be called meaningful only when the variables are in the same system.

It makes no sense:

A + B

But in the system of css styles it could be meaningfule:

height(100) + width(100) + block

Operators

Jellymarker now supports binary operators: +, -, * and /.

jellymarker.registerOperators('+', function(v1, v2) {
    // your rule
});

Then you can use operator '+' in the script.

and '*' and '/' 's priority is higher than '+' and '-'.

APIs

Jellymarker's instance has compile and eval function to parse the script.

The difference between compile and eval is that compile doesn't have return values and eval return the value of the first expression (statement). Statements are sepreated by token '\n' or ';'.

//using ';'
'C = A + B; D = A - B';

//using '\n'
'C = A + B \n D = A - B'

complie

You can get the runtime values of all variables through the build-in attribute variables after compile,

var Jellymarker = require('jellymarker');

var jellymarker = Jellymarker.create();

jellymarker.registerVariables('A', {v:'Hi'})

jellymarker.registerVariables('B', {v:'Bob'})

jellymarker.registerOperators('+', function(v1, v2) {
    return {
        v: v1.v + ' ' + v2.v
    }
});

jellymarker.registerOperators('-', function(v1, v2) {
    return {
        v: v2.v + ' ' + v1.v
    }
});

jellymarker.compile('C = A + B; D = A - B;');

console.log(jellymarker.variables);

The output:

{
    A: { v: 'Hi' },
    B: { v: 'Bob' },
    C: { v: 'Hi Bob' },
    D: { v: 'Bob Hi' }
}

eval

Eval is the same with compile except that it return the value of first statement parsed.

console.log(jellymarker.eval('C = A + B; D = A - B;'));

The output:

{ v: 'Hi Bob' }

After run eval, the runtime value of attribute instance.variables will be affected.