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

stets

v0.0.2

Published

EMERGED STETS - Date based stats collection and statistical analytics

Downloads

34

Readme

EMERGET! STETS!

Stets is a node.js library to do statistical analysis of date based data sets. This allows you get average etc. over the course of a month, week, year.

Installation

YE KEN INSTELL STETS WIT NPN

npm install --save stets

Usage

In all examples we assume that you loaded and constructed your Stets instance as following:

var Stets = require('stets')
  , stets = new Stets();

The Stets constructor can receive one argument which is used to configure the instance. The follow options are accepted:

  • format The format in which the supplied dates are stored. The format that we accept is the same format as Momentjs uses (as that is parsing our dates).
  • stats Configuration for the fast-stats module that we wrap.

Now that we have fully configured Stets instance we can start adding data.

Stets.push

We implement methods that are somewhat identical to arrays. So for adding data you need to the .push method. The only difference is that we require 2 arguments. The first argument is the date of the stat and the second is the value that needs to be stored.

stets.push(new Date(), 1);

Stets.unshift

Same above but it adds the stats to the beginning of internal set instead of at the end of it.

stets.unshift(require('moment')(), 424);

In this example we don't supply a Date instance but a moment instance, as that is also supported.

Stets.pop

Now that we've added data, we also need to be able to remove it. That is where stets.pop comes it. It removes the item from the end of the internal set and returns it the object that we stored.

The returned object contains data and date keys. date contains the supplied date instance while data stores assigned data.

stets.push(new Date(), 2);
var last = stets.pop();

console.log(last.data); // 2

Stets.shift

Just the like stets.pop method, but it returns the first item that we've added.

stets.push(new Date(), 1);
stets.push(new Date(), 2);

var first = stets.shift();
console.log(first.data); // 1

Stets.length

To see how many data points are currently store you can check the .length property.

console.log(stets.length); // 0
stets.push(new Date(), 1);
console.log(stets.length); // 1

Stets.reset

If you want to start over fresh again, you can completely nuke all the stored data using the stets.reset method.

console.log(stets.length); // 0
stets.push(new Date(), 1);
console.log(stets.length); // 1
stets.reset();
console.log(stets.length); // 0

License

MIT