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

meep

v1.0.0

Published

A Multi-dimensional Map

Readme

Meep

A Multi-dimensional Map

Theory

Say you have some sort of many to many dataset, with lots and lots of dimensions, and you want to filter it down to where only a couple of the dimensions you don't care about it's value. So for example you have a dictionary of three letter words and you want to find all the words that fit _at

const Meep = require('meep')
const meep = Meep().null('_')

meep('bat',{word:'bat'})
meep('ben',{word:'ben'})
meep('sat',{word:'sat'})
meep('mat',{word:'mat'})
meep('bed',{word:'bed'})

meep('_at') // => [{word:'bat'},{word:'sat'},{word:'mat'}]

Instead of filtering through a large list, I store the data in a tree structure. For the dataset in the previous example it would look something like this

{
  b:{
    a:{ t:{word:'bat'} },
    e:{
      n:{word:'ben'},
      d:{word:'bed'},
    },
  },
  s:{ a:{ t:{word:'sat'}}},
  m:{ a:{ t:{word:'mat'}}}
}

And then uses a list of iterators which gets spread for every don't care. So definitly not efficient for small data sets, but maybe better for certain types of data. At least I hope.

Methods

meep(key <iterable>, [value]) Get/Set values in the map

meep.null( [value] ) Get/Set the null value (useful for when using string keys)

meep.var(key, [value]) Get/Set a filter function interpretation for a certain value

Basic Usage

const Meep = require('meep')
const meep = Meep().null('_')

meep('000',0)
meep('100',1)
meep('010',2)
meep('110',3)
meep('001',4)
meep('101',5)
meep('011',6)
meep('111',7)

/* All of these return the same thing cause they all specify the value for '1' to be '0' and the other values are left undefined */
meep('_0_') // => [0,1,4,5]
meep([,0,]) // => [0,1,4,5]
meep({1:0}) // => [0,1,4,5]

/* If nothing specified then returns everything */
meep('') // => [0,1,2,3,4,5,6,7]

/* Can also set multiple values at the same time, so be careful */
meep('','MEEP!') // Overwrites all the data
meep('') // => ['MEEP!','MEEP!','MEEP!','MEEP!','MEEP!','MEEP!','MEEP!','MEEP!']

Filters

const Meep = require('meep')
const meep = Meep()

meep({color:'white',shape:'circle',size:0},'⚪️')
meep({color:'red',shape:'circle',size:1},'🔴')
meep({color:'blue',shape:'circle',size:1},'🔵')
meep({color:'black',shape:'circle',size:0},'⚫️')
meep({color:'orange',shape:'diamond',size:1},'🔶')
meep({color:'blue',shape:'diamond',size:2},'🔷')
meep({color:'blue',shape:'diamond',size:0},'🔹')
meep({color:'black',shape:'square',size:2},'⬛️')
meep({color:'black',shape:'square',size:1},'◼️')
meep({color:'black',shape:'square',size:0},'▪️')

/* Basic Usage */
meep({color:'black',shape:'square'}) // => ['⬛️','◼️','▪️']

/* If a value as set as a function, it will be used as a filter function */
meep({ 
  // colors that start with 'b'
  color:function(n){ return n[0] == 'b'}, 
  
  // sizes greater or equal to 1
  size:function(n){ return n >= 1 }, 
})
// => [ '🔵', '🔷', '⬛️', '◼️' ]

/* Can also set values to be interprutated as filter functions */
meep.var('warm',n => n=="red"||n=="orange")
meep.var('sharp',n => n=="diamond"||n=="square")

meep({color:'warm'}) // => [ '🔴', '🔶' ]
meep({shape:'sharp'}) // => [ '🔷', '🔹', '⬛️', '◼️', '▪️', '🔶' ]
meep({color:'warm',shape:'sharp'}) // => [ '🔶' ]