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

passlet

v4.0.0

Published

Generate Apple Wallet and Google Wallet passes from a single API

Readme

What is this?

Apple and Google both put cards in a phone's wallet: loyalty cards, tickets, boarding passes. They agree on nothing else. Apple wants a signed .pkpass archive; Google wants a JWT backed by a REST API, with different field names, layouts and rules.

Passlet lets you describe a pass once. One call returns a signed .pkpass for Apple and a save link for Google, and one more keeps both up to date on the holder's phone.

Quick start

npm install passlet
import { field, Wallet } from "passlet";

const wallet = new Wallet({ apple: appleCredentials, google: googleCredentials });

const rewards = wallet.loyalty({
  id: "rewards",
  name: "Coffee Club",
  apple: { icon: "https://example.com/icon.png" },
  google: { logo: "https://example.com/logo.png" },
  fields: [field.primary("points", "Points")],
});

const pass = await rewards.create({ serialNumber: "member-123", values: { points: "1250" } });
// pass.apple → .pkpass bytes · pass.google → JWT for googleSaveUrl()

Runs on the server, Node.js 20.19+ or 22.12+, with no dependencies. Leave out either wallet to use just one. Getting credentials: Credentials.

Pass types

| Method | For | Apple | Google | |---|---|---|---| | loyalty() | Rewards and memberships | Store card | Loyalty | | eventTicket() | Concerts, matches, conferences | Event ticket | Event ticket | | boardingPass() | Flights, trains, buses, ferries | Boarding pass | Flight or transit | | coupon() | Offers and discounts | Coupon | Offer | | giftCard() | Prepaid balances | Store card | Gift card | | generic() | Anything else | Generic | Generic |

Features

  • Apple and Google from one definition: a signed .pkpass and a Google save link from the same call
  • Fields on the front and back, with date, number and currency formatting
  • Barcodes: QR, PDF417, Aztec, Code 128 and more, plus rotating codes on Google
  • Images from URLs or bytes: icons, logos, strips, thumbnails and Google hero images
  • Translations for every field, in both wallets
  • Lock-screen relevance by date and location, and NFC (Apple NFC passes, Google Smart Tap)
  • Updates after issue, with a notification on the holder's phone when a value changes
  • Several passes in one download, like a family's tickets or every leg of a trip

Documentation

Contributing

Issues and PRs welcome. Setup, tests and releases are in CONTRIBUTING.md; report security issues as described in SECURITY.md.

License

MIT


Built by Oscar Treviño