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 🙏

© 2024 – Pkg Stats / Ryan Hefner

set.up

v0.0.0

Published

sets, upgraded

Downloads

3

Readme

Collection tools

Creates 2 new objects, setUp and mapUp, each with 2 methods, setUp.shim() and mapUp.shim() adds all of these to Set.prototype or Map.prototype (if they are not already there) while setUp._() and mapUp._() add them prefixed with an underscore.

Currently only works in firefox as V8 does not have iteration of Set and Map yet, and IE has yet to produce a browser that will run on any of my computers.

Set API

stuff from Array.prototype

these are all identical to their version on array, the only differences being the functions are not called with index as an argument and length is not cached at the beginning so values may be added during iteration.

  • Set.prototype.map
  • Set.prototype.filter
  • Set.prototype.reduce
  • Set.prototype.some
  • Set.prototype.every

new stuff

  • Set.prototype.equals takes another set, returns true if they are the same size and the other set has all the same values as this set.
  • Set.prototype.merge takes one or more sets as arguments, returns a new set which merges those sets to this one.
  • Set.prototype.append takes one or more sets as arguments, adds their values to the current set and returns it.
  • Set.prototype.union points to merge
  • Set.prototype.toArray returns the values of the set, results are sorted and it takes an optional sort function.
  • Set.prototype.intersection takes another set, returns a new set with only those values that are in both.
  • Set.prototype.xor takes another set, returns a new set only those values that are in just one set.
  • Set.prototype.symmetricDifference same as xor
  • Set.prototype.compliment takes another set, returns a new set with all those items in the first set, but not in the second set

Map API

the same as the set stuff but every callback that took a value for set takes a value, key for Map

  • Map.prototype.map returns a set
  • Map.prototype.filter
  • Map.prototype.reduce function called accumulator, value, key, map, if no accumulator is given as argument first VALUE is used
  • Map.prototype.some
  • Map.prototype.every
  • Map.prototype.equals
  • Map.prototype.merge if the value is already in the map it is not replaced
  • Map.prototype.append if the value is already in the map it is not replaced
  • Map.prototype.toObject turns it into an object, some of the keys may be stringified