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

@latimer-woods-tech/push

v0.1.0

Published

Workers-native push notification primitive. Two delivery channels behind one small surface:

Readme

@latimer-woods-tech/push

Workers-native push notification primitive. Two delivery channels behind one small surface:

  • Web Push (browsers / PWAs) — VAPID auth (RFC 8292) + aes128gcm payload encryption (RFC 8291), all via crypto.subtle.
  • FCM v1 (Capacitor / Android) — device-token send with a self-minting Google service-account OAuth2 token provider (RS256 JWT bearer grant).

No process.env, no Node built-ins, no Buffer; every fetch is error-handled. FCM is free — no vendor-spend gate applies.

Install

// package.json
"dependencies": {
  "@latimer-woods-tech/push": "^0.1.0"
}

Requires @latimer-woods-tech/errors and @latimer-woods-tech/logger as peers (both are runtime dependencies of this package).

Web Push

import { sendWebPush } from '@latimer-woods-tech/push';

const vapid = {
  publicKey: env.VAPID_PUBLIC_KEY,   // base64url, 65-byte uncompressed P-256 point
  privateKey: env.VAPID_PRIVATE_KEY, // base64url, 32-byte scalar
  subject: env.VAPID_SUBJECT,        // 'mailto:[email protected]'
};

const res = await sendWebPush(subscription, JSON.stringify({ title: 'Hi' }), vapid, {
  ttl: 60 * 60,
  urgency: 'high',
});

if (res.expired) {
  // 404/410 → the subscription is gone; prune it from your store.
  await store.deleteSubscription(subscription.endpoint);
}

sendWebPush never throws on an HTTP status — a 2xx sets success, a 404/410 sets expired, anything else leaves both false (and logs at error if a logger is supplied). Only a rejected transport (fetch) throws.

FCM (Android / Capacitor)

import { createGoogleAccessTokenProvider, createFcmSender } from '@latimer-woods-tech/push';

const getAccessToken = createGoogleAccessTokenProvider({
  clientEmail: env.FCM_CLIENT_EMAIL,
  privateKey: env.FCM_PRIVATE_KEY, // PEM PKCS#8
  projectId: env.FCM_PROJECT_ID,
});
const fcm = createFcmSender({ projectId: env.FCM_PROJECT_ID, getAccessToken });

await fcm.send({ token: deviceToken, title: 'Focus', body: 'Time to lock in' });

The token provider caches the minted OAuth token until ~1 minute before expiry.

Unified client

import { createPushClient } from '@latimer-woods-tech/push';

const push = createPushClient({
  vapid,
  fcm: { clientEmail, privateKey, projectId }, // omit to disable FCM
});

await push.sendWebPush(subscription, payload);
await push.sendFcm({ token, title: 'Hi' });

Consumers

  • FocusBro Phase A — web-push check-ins (build the package here, Bro consumes).
  • Prime Self Android — FCM device delivery.

Versioning

Semantic-versioned per PLATFORM_STANDARDS.md §17.3. Published to npm on a push/vX.Y.Z tag.