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 🙏

© 2025 – Pkg Stats / Ryan Hefner

kaizen

v0.1.5

Published

ExpressJS Log Middleware

Readme

Kaizen

ExpressJS Log Middleware

Features

  • stores log information in a persistence layer of your choice
  • pretty prints colored and structutred output
  • implements base16 color schemes and allows to create custom ones
  • plug-in system to create your own DB adapters

Install

npm install kaizen

Usage

Basic
var Kaizen = require('kaizen');

var kaizen = new Kaizen();

app.use(kaizen.log());

//your routes here

app.use(kaizen.error());
Choose a different color scheme
var config = {
    style: 'railscasts'
};

var kaizen = new Kaizen(config);

app.use(kaizen.log());

//your routes here

app.use(kaizen.error());
Use your color scheme
var config = {
    style: {
        '00': '#001100',
        '01': '#003300',
        '02': '#005500',
        '03': '#007700',
        '04': '#009900',
        '05': '#00bb00',
        '06': '#00dd00',
        '07': '#00ff00',
        '08': '#007700',
        '09': '#009900',
        '0A': '#007700',
        '0B': '#00bb00',
        '0C': '#005500',
        '0D': '#009900',
        '0E': '#00bb00',
        '0F': '#005500'
    }
};

var kaizen = new Kaizen(config);

app.use(kaizen.log());
Write to MongoDB
var Kaizen = require('kaizen');
var k_mongodb = require('kaizen-mongodb');

var config = {
    uri: 'mongodb://user:password@localhost/yourdb',
    collection: 'foobar',
    stdout: false,
    style: 'railscasts'
}
var kaizen = new Kaizen(config, k_mongodb);

app.use(kaizen.log());

//your routes here

app.use(kaizen.error());
Create your own Adapter
// Write a module which exports 2 functions: connect() and save() 

exports.connect = function(config) {
    // handle the connection to DB
    // config arg is the one you passed to Kaizen constructor
    // example: {
    //        uri: 'mongodb://user:password@localhost/yourdb',
    //        collection: 'foobar',
    //        stdout: false,
    //        style: 'railscasts'
    //    }
};

exports.save = function(obj) {
    // handles req,res and error messages parsing/saving to DB
    // obj example:
    // {
    //   "req": {
    //     "headers": {
    //       "user-agent": "curl/7.22.0 (x86_64-pc-linux-gnu)",
    //       "host": "127.0.0.1:3000",
    //       "accept": "*/*"
    //     },
    //     "body": {},
    //     "method": "GET",
    //     "url": "/",
    //     "protocol": "http",
    //     "version": "1.1"
    //   }
    // }

};

// require and pass it to kaizen with your config options:
var kaizen = require('kaizen');
var yourmod = require('yourmod');

var kaizen = new Kaizen(config, yourmod);

app.use(kaizen.log());

sample mongodb adapter for reference: https://github.com/Shoen/kaizen-mongodb