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

stack-core

v2.5.0

Published

A command driven middleware stack for managing control flow / application state

Readme

Stack

Stack is a route driven state management library that leverages the familiar callback and middleware pattern used in Express.

Install

npm install --save stack-core

Usage

var stack = require('stack-core')

stack.on('/do-something', (state, next) => {
   //modify state here, then pass it along: 
   next(null, state)
})

stack.fire('/do-something')

Unlike Express however, instead of http requests the idea is to pass your entire application's state through your 'stack' of listeners. Each execute in order, asynchronously, passing along the modified state via next()

The main benefit to this approach is the set of 'commands' (ie: routes) your application now inheritently exposes; essentially an API you can tap into from anywhere, including from modules you later introduce or from outside contributors who can standardize around your stack as the formal way to extend and create new functionality in your app.

API

stack.on(command, callback)
Creates a listener that invokes callback on the given command

stack.fire(command, state, callback)
Fires an arbitrary command causing the stack of listeners listening to that command to fire (in order) until the end of the stack.

Properties

stack.state
The last known state of the stack. Persists after a fire concludes; after the bottom of the stack is reached hence the updated state is retained and available to subsequent fires.

stack.state._command
A special property added to your state object to keep track of the current command being issued. Analogous to req.parms in Express.

stack.state._command[parameter]
Any number of parameters on the command itself (ie: /do-something/:time are made available as a property of the stack.state._command object (ie: stack.state._command.time).

License

MIT