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

whammo

v0.5.4

Published

minimalist componentized servers

Readme

whammo.js

NPM version npm Travis

Experimental!

I find what I really want is a lightweight library that can serve as the basis for a number of delivery strategies, and often found myself using http directly. But that tends to be very verbose, so I wanted something a little neater... but without assuming everything... so I built this. It handles request isolation, logging, errors, supports many complex configurations and handles everything with streams. This is a much more experimental version than previous releases... If this new streaming incarnation stabilizes, it will cease to be experimental.

While the return happens according to the precedence you set, it's important to note: the processing of all actions is in parallel streams, so work for this request is still being performed even during individual async waits.

Usage

You express a server as a stack of operations, and the first one (by position) to produce output gets output to the user.

var Server = require('whammo');

application = new Server({
	actions : <action_list>
});

This list uses director and handles GETs and POSTs the same way and dumps errors as parseable JSON.

{ name : 'http-file', with:{
	types:['png', 'json', 'js', 'html', 'css']
}},
{ name : 'get-vars' },
{ name : 'post-vars'},
{ name : 'director-router', with : {
	routes : {
		'/test' : {get:function(){
			console.log(this.req);
			this.res.end('Got it!');
		}}
	}
}},
{ name : '404' , with : {json : true}}

This sample is a more traditional server with compression, conditional POST processing and HTML error output:

{ name : 'http-file', with : { types : [
	'png', 'gif', 'jpg', 'jpeg', 'json', 'js', 'html',
	'ttf', 'eot', 'woff', 'ico', 'otf', 'css', 'svg'
]}, then: { name : 'compress'}},
{ name : 'get-vars' },
{ name : 'post-vars', when : { method : {'$eq':'POST'}}},
{ name : 'director-router', with : {
	routes : {
		'/test' : { get : function(){
			this.res.end('Got it!');
		}}
	}
}},
{ name : '404', then: {name : 'compress'}}

Then, finally, you'll need to start the app:

application.listen(8081);

Built-In Actions

In whammo each server is a stack of actions (ordered by precedence) which may then pipline to child actions. In this way, many complex configurations can be achieved through a simple set of operations. These actions can be conditionally enabled using the when field using Mongo Query Document syntax and link their output to other actions with then and can pass configuration options using with. Other fields are action specific.

  • http-file : output any files that match provided types and exist
  • get-vars : process GET vars and attach them to the request object
  • post-vars : process POST vars and attach them to the request object
  • director-router : use director to handle the provided routes
  • pagejs-router : use pagejs to handle the provided routes
  • pack-js : use webpack to deliver bundled js + dependencies (/__bundle_js/<filepath>)
  • 404 : outputs a 404 page to the user
  • compress : compress data as it streams through

Command Line[TBD]

Precaching bundles for build or deployment

whammo precache /path/to/my/file.js

Launch a server from a config file:

whammo -c config.json

Roadmap

  • finish webpack support
  • support short circuiting the stream(in some cases)
  • support stream output
  • mangrove integration

Testing

Tests use mocha/should to execute the tests from root

mocha

If you find any rough edges, please submit a bug!

Enjoy,

-Abbey Hawk Sparrow