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

@fmpanelli/generate-jwt

v0.0.2

Published

Little utility to generate a Google access token

Downloads

6

Readme

generate-jwt

Little utility to generate a Google JWT access token for testing.

Prerequisites

Just Node.

Getting Started

Iaaa

Setup of your local environment

.env file

The setup of your local enviroment is done with the .env file. This is a file where you can specify enviroment variables that will be loaded into node.js when running locally.

You can find a .env.example in the git repo. Copy it to .env and adjust it to your needs. The file .env will be ignored by git.

The project is setup in a way such that the .env configuration will be used for all local needs, i.e.:

  • running tests when you hit npm test
  • running tests within VS Code (I use Jest extension by Orta)
  • running a local server, which you can do by npm run local_server

Note: you can also setup the same variables from the command line and, actually, if the variables are set from the CLI, the corresponding values in .env file will be ignored.

I found two tricky points in using env variables set in CLI:

  1. you have to setup the variables before launching vscode in order for them to be visible by vscode extensions
  2. terminals launched within vscode will not inherit those variables

Prepare for Google authentication

The first step is creating a Google Service Account, that is a technical account on GCP, and giving you local node.js the credentials to login with that account:

  • create a Google service account
  • create a key im json format
  • download the json and save it here under ./credentials folder (it will be ignored by Git)
  • set the enviroment variables (possibly using .env)
    • GCLOUD_PROJECT
    • GOOGLE_APPLICATION_CREDENTIALS

The second step is to grant your service account access to the Spreadsheet it needs access: simply open the spreadsheet click on share and type the email address of the service account.

Oh, my proxy!

When running inside Credem's network you may encounter several obstacles dealing with the proxy.

As of Feb 2020 the following works for me:

  • For googleapis library to work correctly you should have HTTP_PROXY and HTTPS_PROXY set to http://proxyre02.group.credem.net:8080 (possibly using .env)
  • You should point Internet Exporer or another proxy to the same proxy and authenticate.
  • The authentication will last for 15 minutes for the shole machine. So be sure to visit a new page in IE every 15 minutes.

Testing

Test is done with jest and ts-jest.