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

@wptom/waitlist

v0.3.0

Published

A waitlist endpoint for any Astro site: validation, bot protection and storage in Supabase, with no dependencies.

Readme

@wptom/waitlist

A waitlist endpoint for Astro (or any runtime with the Fetch API): validation, bot protection, duplicate handling and storage in Supabase or a Mailchimp audience. Part of the WPTom integrations: the logic, and components that take your template's look.

// src/pages/api/waitlist.ts
import type { APIRoute } from 'astro';
import { createWaitlistHandler, memoryStore, supabaseStore } from '@wptom/waitlist';

export const prerender = false;

const handle = createWaitlistHandler({
  store: process.env.SUPABASE_URL
    ? supabaseStore({ url: process.env.SUPABASE_URL, key: process.env.SUPABASE_SECRET_KEY! })
    : memoryStore(), // development only
  redirect: { success: '/waitlist/thanks' },
  onJoin: async (entry) => {
    // e.g. send a welcome email with @wptom/email
  },
});

export const POST: APIRoute = ({ request }) => handle(request);
<form action="/api/waitlist" method="post">
  <input name="email" type="email" required />
  <input name="source" type="hidden" value="home" />
  <!-- bots fill this, people never see it -->
  <input name="company_website" tabindex="-1" autocomplete="off" hidden />
  <button>Join</button>
</form>
  • Plain form posts are redirected (303) to redirect.success, or back with ?error=….
  • fetch calls with Accept: application/json get { ok, alreadyJoined } or { ok: false, error }.
  • onJoin runs only for new signups; its errors are logged and never shown to the visitor.

Supabase table

Run once in the SQL editor:

create table public.waitlist (
  email text primary key,
  source text,
  created_at timestamptz not null default now()
);
-- Row level security on and no policies: only your server's secret key can write.
alter table public.waitlist enable row level security;

Use a secret API key from Project Settings → API Keys, only on the server.

Mailchimp

import { mailchimpStore } from '@wptom/waitlist';

const store = mailchimpStore({
  apiKey: process.env.MAILCHIMP_API_KEY!, // Account → Extras → API keys; ends with the data center, e.g. -us21
  audienceId: process.env.MAILCHIMP_AUDIENCE_ID!, // Audience → Settings → Audience name and defaults
  doubleOptIn: false, // true: Mailchimp sends its confirmation email; the contact is "pending" until then
});

Adds each signup to the audience as subscribed (or pending with double opt-in), tagged with its source. An address already in the audience, whatever its status, is left as it is and reported as added: false, so onJoin doesn't run again. A key without its data-center suffix throws when the store is created.

Astro component

---
import SignupForm from '@wptom/waitlist/SignupForm.astro';
---
<SignupForm source="home" emailLabel="Email" placeholder="[email protected]" button="Join"
  joining="Joining…" joined="You're on the list." alreadyJoined="You're already on the list."
  invalidEmail="Check your email." error="Something went wrong." />

Posts to /api/waitlist (action to change it) for a waitlist or a newsletter; tone="photo" for a form over a photo.

Styled only with your site's CSS variables (--brand-bg, --brand-panel, --brand-text, --brand-muted, --brand-border, --brand-button, --brand-on-button, --brand-link, --brand-radius, --brand-button-radius, --font-heading, --font-mono), so it takes your look; every text is a prop, so editors can change it in the CMS.

No dependencies. MIT License.