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

otp-service

v1.0.1

Published

TOTP/HOTP code generator and auth

Readme

OTP-Service

generateToken

Will generate a couple secret, token.

  • Secret is a base32 encoded hex secret key.
  • Token is the current OTP (6 int)

Param: Key (optional) will pass the key as a secret to generate the current token

Example: npm run generate:token --key=\"KMEASRS2IUFH2OZ2\"

generateQRCode

Will generate a QRCode that can be scan with an auth app (compatible with Google Authenticator).

The QR code generated is a png data image in base64.

It can be passed as src in an HTML img tag.

  <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMQAAADECAYAAADApo5rAAAAAklEQVR4AewaftIAAAjWSURBVO3BQY4kyZEAQdVA/f/Luo09OOzkQCCzeoakidgfrLX+38Na63hYax0Pa63jYa11PKy1joe11vGw1joe1lrHw1rreFhrHQ9rreNhrXU8rLWOh7XW8bDWOn74kMrfVHGj8k0Vn1C5qbhReaNiUpkq/iaVv6niEw9rre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+mMlXcqEwVb1RMKjcVk8qkclMxqbyhMlV8omJSmVSmiknlEyqfUJkqJpVvelhrHQ9rreNhrXXYH/wHU5kqPqHyRsUbKlPFjcobFZPKVPEJlZuKN1SmihuVm4pPPKy1joe11vGw1jp++JDK31QxVUwqb1RMFTcqk8pUMal8U8UbFZPK36QyVdyo3FT8poe11vGw1joe1lrHD19W8U0qNypTxaTymypuKiaVSWWqmCpuVKaKSWWq+CaVm4o3Kv5JD2ut42GtdTystY4ffpnKGxWfUJkq3lCZKm5UpopJ5Q2Vb6qYVG4qJpU3VD6hclPxmx7WWsfDWut4WGsdP/yPUbmpmFTeUJkqJpWpYlKZKj6hMlV8ouJvUvmbHtZax8Na63hYax0//JdTuan4pop/ksqNyk3FVDGpTBWTyjdVTCpTxTc9rLWOh7XW8bDWOn74ZRW/qWJS+ZsqJpVvUpkqJpWpYlKZKiaVG5VPVNyoTBWTyt/0sNY6HtZax8Na6/jhy1T+JpWpYlK5UZkqpopJ5RMVk8pU8QmVG5WpYlKZKm5UpopJZaq4Ubmp+E0Pa63jYa11PKy1DvuDtdb/e1hrHQ9rreNhrXU8rLWOh7XW8bDWOh7WWsfDWut4WGsdD2ut42GtdTystY6HtdbxsNY6HtZax/8BoKexvuEC+ZQAAAAASUVORK5CYII=" />

Param: User to display in the auth app Service to display in the auth app Secret used to generate the qrcode

Example: npm run generate:qrcode --user=\"123\" --service=\"goof\" --secret=\"KMEASRS2IUFH2OZ2\"

validate

Will match secret with current token and return true if valid.

Param: Secret is the secret used to generate the token Token is the currrent OTP provided by generateToken or by an app

Example: npm run validate --secret=\"KMEASRS2IUFH2OZ2\" --token=\"123456\"