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

@o.mhadhbi/jsonwebtoken

v8.4.0

Published

This version supports jwt signed using ES256K algorithm and ethereum keys or sjcl keys.

Readme

jsonwebtoken

This is a fork of node-jsonwebtoken branch f9ba002 (version: 8.4.0).This version supports jwt signed using ES256K algorithm and ethereum keys or sjcl keys.

Install

$ npm install  jsonwebtoken@npm:@o.mhadhbi/jsonwebtoken

To override the original jsonwebtoken package but preserve all names.

Usage

If you are going to use ES256K algorithm, you have to provide an implementation of sign and verify functions.

Note: If you just want to sign and verify jwt using ES256K algorithm and ethereum keys, you can directly use jsontokens.

Example 1 with Ethereum public key:

//import { TokenVerifier } from 'jsontokens';

{
      jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
      secretOrKey: config.ethereumPublicKey`,
      jsonWebTokenOptions: {
        cryptoManager: {
          verify: (jwt: string, ethereumPublicKey: string, algorithm: string) => {
            return new TokenVerifier(algorithm, ethereumPublicKey).verify(jwt);
          },
        },
        keyName: 'Ethereum', //must be 'Ethereum'
      },
    }

Example 2 with sjcl keys:

//sjcl = require('sjcl')

let cryptoManager;
cryptoManager.keys['keyname'] = sjcl.ecc.ecdsa.generateKeys(sjcl.ecc.curves.k256);
cryptoManager.verify = (keyname, hash, signature) =>  {
  if(!cryptoManager.keys['keyname']) {
    throw new Error('Key not found');
  }
  const pair = cryptoManager.keys[keyname];
  return pair.pub.verify(sjcl.codec.hex.toBits(hash), sjcl.codec.hex.toBits(signature));
}

Algorithms supported

Array of supported algorithms. The following algorithms are currently supported.

| alg Parameter Value | Digital Signature or MAC Algorithm | | ------------------- | ---------------------------------------------------------------------- | | HS256 | HMAC using SHA-256 hash algorithm | | HS384 | HMAC using SHA-384 hash algorithm | | HS512 | HMAC using SHA-512 hash algorithm | | RS256 | RSASSA-PKCS1-v1_5 using SHA-256 hash algorithm | | RS384 | RSASSA-PKCS1-v1_5 using SHA-384 hash algorithm | | RS512 | RSASSA-PKCS1-v1_5 using SHA-512 hash algorithm | | PS256 | RSASSA-PSS using SHA-256 hash algorithm (only node ^6.12.0 OR >=8.0.0) | | PS384 | RSASSA-PSS using SHA-384 hash algorithm (only node ^6.12.0 OR >=8.0.0) | | PS512 | RSASSA-PSS using SHA-512 hash algorithm (only node ^6.12.0 OR >=8.0.0) | | ES256 | ECDSA using P-256 curve and SHA-256 hash algorithm | | ES256k | ECDSA using SECP256K1 curve (*) | | ES384 | ECDSA using P-384 curve and SHA-384 hash algorithm | | ES512 | ECDSA using P-521 curve and SHA-512 hash algorithm | | none | No digital signature or MAC value included |