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

sad

v1.0.8

Published

X-Clacks-Overhead header plugin for Hapi.js apps

Downloads

72

Readme

sad

A Hapi.js Plugin to add X-Clacks-Overhead: GNU Terry Pratchett header to your projects.

Build Status Code Climate Test Coverage Dependencies Node version HAPI 8.2 NPM Version

Why?

On Thursday 12th March 2015 Terry Pratchett passed away.
This little Hapi.js Plugin keeps him alive "in the code".

“We keep that name moving in the Overhead,” he said, and it seemed to
Princess that the wind in the shutter arrays above her blew more forlornly,
and the everlasting clicking of the shutters grew more urgent.
“He’d never have wanted to go home. He was a real linesman.
His name is in the code, in the wind in the rigging and the shutters.
Haven’t you ever heard the saying: ‘A man’s not dead while his name is still spoken’?

Even if you are not a Fan of Terry's work, I highly recommend watching the Documentary

What?

This node module (Hapi.js plugin) simply adds the "GNU Terry Pratchett" header
to all out-going http replies in you Hapi.js Web App/Site.

Usage

Install from NPM

npm install sad --save

Register the Plugin in your Server

in your server.js (or what ever you prefer to name it)

var Hapi   = require('hapi');
var server = new Hapi.Server();
var PORT   = process.env.PORT || 8000;

server.connection({ port: PORT });

server.register([ { register: require('sad') } ], function (err) {

  server.route({
      method: 'GET',
      path: '/',
      handler: function (request, reply) {
          reply(“We will miss you Terry”);
      }
  });
});

server.start(function(){
  console.log('Now Visit: http://localhost:'+PORT);
});

module.exports = server;

Confirm its Working

Run your server in your usual way e.gx:

node server.js

Then check that its working by issuing the following curl command:

curl -I http://127.0.0.1:8000/

You should expect to see something like this:

X-Clacks-Overhead: GNU Terry Pratchett
content-type: text/html; charset=utf-8
cache-control: no-cache
Date: Tue, 17 Mar 2015 10:04:32 GMT
Connection: keep-alive

The first line is the important one.

Further Reading

http://www.reddit.com/r/bestof/comments/2yyop7/rdiscworld_redditors_with_web_servers_start/%22%3Ethis