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

express-hash

v1.0.1

Published

Utility to ensure the authenticity of a request

Readme

express-hash

Tiny tool to check the authenticity of request in client server communication that can be used as a middleware in server side and simple function at client side

How to Use

Tool contains two parts

Client

Generate the hash at client side by leveraging the 'sign' option.

Server

 Verify the authenticity of the request by making use of the server side 'verify' option

Please note the server will expect the generated hash in the request header by the key 'signature'

defaults.json

You can provide the necessary details in a json format as below. In the absence of those details defaults values will be assumed

Sample json

 {
    "hashKey":"cf4252f9bc4753c7f798c0a9973b6e70",
    "limit": 60,
    "algorithm":"md5",
    "data":{
        "query":{},
        "body":{}
    },
    "method":"GET"
}

Sample hash generation

const exphash= require('express-hash');
const defaults= require('./defaults.json');

const msg= exphash.sign(defaults);
console.log('Generated hash ',msg);

Result
Generated hash  B516D37C0F1C4C74C48BF44056381DD8A3956C3764A5D3692772076CEE5800C097FFD1991DBE606E999F7BEFEE0BF42EC292D7A595F5CDFDF30F2704CBE9BC0F

Actions at server side

The verify function is a middleware and you can pass the configurations in the same structure as used in client side(Please use the same hashKey at both sides)

It will verify the authenticity of the request.

You can check the authenticity with the request time as well(can be configuired under limit section. Defaults to 60 seconds)

If the request looks fine it will pass to next section