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

dashboards

v0.0.2

Published

Simple and pluggable dashboards

Downloads

31

Readme

dashboards

Simple and pluggable dashboards.

var Dashboards = require('dashboards');

var dashboards = new Dashboards()
  .use(subscriptions('stripe-key'))
  .use(charges('stripe-key'))
  .use(support('helpscout-key'))
  .use(pipe('active tickets', geckoboard('widget-id').number)
  .run();

It's easy to get started: there's already plugins for Stripe, Helpscout, AWS, and others.

It separates data and views: make your own decisions about what to put on your dashboards.

It's dashboard agnostic: so you can use Geckoboard, Ducksboard, Leftronic, or your own internal dashboards.

It pushes you in the right direction: use Segment.io's dashboards expertise to avoid the wrong metrics.

Installation

$ npm install dashboards

How does it work?

Dashboards is super simple. You write a plugin that puts data in, and you write plugins that send data to a dashboard. Plugins that need data defer execution until that data is available.

A plugin can learn about how much you're making on Stripe, and make that data available:

var Stripe = require('stripe');

function charges (key) {
  var stripe = Stripe(key);
  return function (data, callback) {
    stripe.charges.list(function (err, charges)) {
        data['charges'] = charges.reduce(function (memo, charge) {
          return memo + (charge.amount / 100);
        }, 0);
        callback();
    });
  };
}

and another plugin can push the charge data to a geckoboard:

var geckoboard = require('geckobard')('api-key');

function ready (data) {
  return data.charges != null;
}

function send (data, callback) {
  geckoboard('widget-id').number(data.charges, callback);
}

and now you have your first dashboard:

var dashboards = new Dashboards()
  .use(charges('stripe-key'))
  .when(ready, send)
  .run();

but wait! waiting for data and piping it to a dashboard gets even easier:

var dashboards = new Dashboards()
  .use(charges('stripe-key'))
  .use(pipe('charges', geckoboard('widget-id').number)
  .run();

Plugins

Existing plugins for dashboards can tell you:

API

new Dashboards()

Create a new Dashboards instance.

#use(plugin)

Add a dashboard plugin which is either a function or an object that contains a fn plugin and a ready function, like so:

{ ready: hasCharges, fn: send }

#when(ready, fn)

Execute the dashboard plugin fn when the ready function returns true. This allows you to wait until you have a piece of data before sending it to a dashboard. Read more about ready functions in parallel-ware.

#run(callback)

Run the dashboard plugins.

License

WWWWWW||WWWWWW
 W W W||W W W
      ||
    ( OO )__________
     /  |           \
    /o o|    MIT     \
    \___/||_||__||_|| *
         || ||  || ||
        _||_|| _||_||
       (__|__|(__|__|