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

@lobsterhoney/edge

v0.2.0

Published

Edge middleware that serves signed dynamic content from your control plane.

Readme

@lobsterhoney/edge

Edge middleware for serving signed dynamic content from your control plane.

Fetches signed, server-authored content from your control-plane origin and serves it at the edge. All content is constructed server-side; this package ships no content generators. Works on Vercel, Cloudflare Workers, Netlify Edge, and Node.

Install

npm install @lobsterhoney/edge

Configuration

interface EdgeConfig {
  apiKey: string;          // Required. API key for your control plane.
  orgSlug: string;         // Required. Organization slug.
  manifestUrl: string;     // Required. Your control-plane ORIGIN, e.g.
                           //   https://<your-lobsterhoney-origin>. Origin only;
                           //   the client derives the rest of the path itself.
  trustBundle: TrustBundle;// Required. The signed trust bundle issued to you at
                           //   onboarding. Pinned here as the sole root of trust
                           //   (the client fails closed without it).
  siteId?: string;         // Optional. Scope to a specific site.
  hitReportUrl?: string;   // Optional. Override where events are POSTed. Defaults
                           //   to the manifestUrl origin.
}

apiKey, orgSlug, manifestUrl, and trustBundle are required. There is no hardcoded control-plane host and no remote trust fetch: you supply the origin, and you pin the trustBundle you were issued at onboarding. manifestUrl is an origin (for example https://<your-lobsterhoney-origin>), not a full path; the client derives its endpoints from that origin. Leave hitReportUrl unset in the normal setup so events post to the same origin; set it only if you route reporting through a separate collector.

The trustBundle and your control-plane origin are provided during onboarding. Store the origin in an env var (LOBSTERHONEY_URL below) so you can switch hosts without editing code.

Environment variables

The examples read two env vars (set them in your platform's project settings / secrets):

| Variable | Maps to | Example | |----------|---------|---------| | LOBSTERHONEY_KEY | apiKey | your control-plane API key | | LOBSTERHONEY_URL | manifestUrl | https://<your-lobsterhoney-origin> |

The examples below assume a pinned bundle in scope:

import type { TrustBundle } from '@lobsterhoney/edge';

// The signed bundle issued to you at onboarding (store it as JSON in your repo
// or a secret, and load it here). Shown abbreviated:
const trustBundle: TrustBundle = {
  version: 1,
  issuedAt: '2026-01-01T00:00:00.000Z',
  keys: [
    {
      kid: 'your-key-id',
      alg: 'ES256',
      publicKey: { /* JWK issued to you */ },
      status: 'active',
      validFrom: '2026-01-01T00:00:00.000Z',
      validUntil: '2027-01-01T00:00:00.000Z',
    },
  ],
};

Vercel

// middleware.ts
import { createMiddleware } from '@lobsterhoney/edge/vercel';

const middleware = createMiddleware({
  apiKey: process.env.LOBSTERHONEY_KEY!,
  orgSlug: 'your-org',
  manifestUrl: process.env.LOBSTERHONEY_URL!, // origin only
  trustBundle,
});

export default middleware;

Cloudflare Workers

The handler returns a Response for a matched path and null otherwise, so fall through to your origin (or fetch(request)) when it returns null. Pass the Worker ctx through so hit reporting runs in the background via waitUntil.

import { createCloudflareHandler } from '@lobsterhoney/edge/cloudflare';

const handler = createCloudflareHandler({
  apiKey: 'YOUR_API_KEY',      // e.g. from env.LOBSTERHONEY_KEY
  orgSlug: 'your-org',
  manifestUrl: 'https://<your-lobsterhoney-origin>', // origin only
  trustBundle,
});

export default {
  async fetch(request, env, ctx) {
    const res = await handler(request, env, ctx);
    return res ?? fetch(request); // null => no match, serve the real origin
  },
};

Netlify Edge

import { createNetlifyHandler } from '@lobsterhoney/edge/netlify';

export default createNetlifyHandler({
  apiKey: Deno.env.get('LOBSTERHONEY_KEY')!,
  orgSlug: 'your-org',
  manifestUrl: Deno.env.get('LOBSTERHONEY_URL')!, // origin only
  trustBundle,
});

Express / Node

import express from 'express';
import { createExpressMiddleware } from '@lobsterhoney/edge/node';

const app = express();
app.use(createExpressMiddleware({
  apiKey: process.env.LOBSTERHONEY_KEY!,
  orgSlug: 'your-org',
  manifestUrl: process.env.LOBSTERHONEY_URL!, // origin only
  trustBundle,
}));

Reporting

Each middleware adapter reports request metadata to your control plane. The event carries metadata only (method, host, client IP, and the ordered list of request header names, never header values or the request body). Delivery is fire-and-forget: it uses keepalive, never throws, and no-ops when no report URL can be resolved. With hitReportUrl unset (the default), events post to the manifestUrl origin.

TypeScript

The public types are exported from the root entrypoint:

import type { EdgeConfig, TrustBundle } from '@lobsterhoney/edge';

Security notes

  • Zero runtime dependencies. Uses only the Web Crypto API, so it runs on Cloudflare Workers, Vercel Edge, Netlify Edge (Deno), and Node 18+ without a bundler shim.
  • No hardcoded backend host. You supply manifestUrl; the client derives its endpoints from that origin.
  • Pinned trust, fail closed. You pin the trustBundle you were issued; there is no remote trust fetch. Manifests are ECDSA (P-256) verified against that pinned bundle before any content is served: the signing key is selected by key id, checked against the bundle's revoked-key list and validity window, and the manifest's own expiresAt is enforced. Construction throws if no bundle is pinned.
  • Minimal telemetry. Reported events include header names, not values, and never the request body.
  • Session cookie is __Host--prefixed (host-locked, Secure, path /) and validated as a UUID on read.

License

MIT