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

boomstick

v1.1.0

Published

Hapi plugin to transform application errors into boom error responses.

Readme

boomstick

Travis Build Status

Hapi plugin to transform application errors into boom error responses. Where each key in the errors object corresponds with a matching boom method.

Usage

var hapi = require('hapi');
var boomstick = require('boomstick');

var server = new hapi.Server();
server.connection();

server.register({
  register: boomstick,
  options: {
    success: function(request){
      return !(request.response instanceof Error);
    },
    errors: {
      badRequest: function(request){
        return (request.response instanceof InvalidRequestError);
      },
      notFound: function(request){
        return (request.response.code === 404);
      }
    }
  }
}, function(){
  server.start();
});

Options Object

  • success: A checkFunction that is executed before all of the potential error cases. If the success case is matched the errors checks are bypassed entirely.

  • 'errors': An Object that contains a key for each boom method you want returned, along with a matching checkFunction for determining when that error case has occured. Each key in the errors object needs to exactly match the name of the boom method that you want executed.

  • 'checkFunction': - A function that returns a boolean and has access to the Hapi request object, for error cases it should return true if that boom error should be generated.

  • 'metadataKey': - A string denoting a key name, if the source Error has a value for that key it will be copied into the final error response. (Default: 'expose')

Additional Details

Boomstick is attached at the onPostHandler point of the Hapi request lifecycle. In the event that the function in the options.success object returns true boomstick will pass the request through untouched. If success returns false each of the other cases is checked and when one is true a boom error is generated and passed into your reply. If none of the errors are matched the request is passed through untouched.

License

MIT