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

@nemesis-shield-autogon/edge

v0.1.3

Published

Nemesis Shield - Edge SDK for Deno / Cloudflare Workers / Vercel Edge / Supabase Edge Functions. Positive-security: learns your app's normal behavior and blocks off-baseline requests (auth bypass, path traversal, scanners) in enforce mode. Web-standard (R

Readme

Nemesis Shield - Edge & Supabase (Deno / TypeScript)

Native TypeScript SDK for serverless edge runtimes: Supabase Edge Functions, Deno Deploy, Cloudflare Workers, and Vercel Edge. Learns the function's normal request behavior; in enforce mode blocks off-baseline requests (auth bypass, path traversal, scanners, unusual methods) before your handler runs. Positive-security, fail-open, privacy-preserving.

Why this matters for Supabase. Edge Functions are public by default - anyone on the internet can hit the URL, with no firewall or implicit login gate - and most run with the service_role key, which steps outside RLS. The function is the trust boundary, with nothing on it. This wraps that boundary with a learned allow-list, so only the request shapes your function actually serves get through.

Install

npm install @nemesis-shield-autogon/edge        # Cloudflare Workers, Vercel Edge, Next.js, bundlers
deno add jsr:@nemesis-shield/edge        # Deno / Deno Deploy / Supabase Edge (or import jsr: directly)

withShield(handler, { token }) wraps any Web-standard (Request) => Response handler - so the same one line works on every edge runtime. Pick your platform:

Supabase Edge Functions (Deno)

import { withShield } from "jsr:@nemesis-shield/edge";

Deno.serve(withShield(
  async (req) => new Response(JSON.stringify({ ok: true }), { headers: { "content-type": "application/json" } }),
  { token: Deno.env.get("NEMESIS_TOKEN") },
));

Set the token: supabase secrets set NEMESIS_TOKEN=nsk_your_app_token.

Deno / Deno Deploy

import { withShield } from "jsr:@nemesis-shield/edge";

Deno.serve(withShield((req) => new Response("ok"), { token: Deno.env.get("NEMESIS_TOKEN") }));

Cloudflare Workers

The token comes from the Worker's env binding (wrangler secret put NEMESIS_TOKEN):

import { withShield } from "@nemesis-shield-autogon/edge";

const app = (req: Request) => new Response("ok");
export default {
  fetch(req: Request, env: { NEMESIS_TOKEN: string }) {
    return withShield(app, { token: env.NEMESIS_TOKEN })(req);
  },
};

Vercel Edge Functions

import { withShield } from "@nemesis-shield-autogon/edge";

export const config = { runtime: "edge" };
export default withShield((req) => new Response("ok"), { token: process.env.NEMESIS_TOKEN });

Next.js Edge Middleware (middleware.ts)

Guards every route in the app before it renders:

import { withShield } from "@nemesis-shield-autogon/edge";
import { NextResponse } from "next/server";

export const config = { matcher: "/:path*" };
export default withShield(() => NextResponse.next(), { token: process.env.NEMESIS_TOKEN });

Self-hosted / on-prem Shield? Add endpoint: "https://your-shield/api/v1/sketches" to the options.

Serverless-safe enforcement

Edge isolates are short-lived, so instead of a background poller the SDK refreshes the compiled policy lazily on the request path (short TTL, deduped) - a cold isolate still enforces the current console mode with no redeploy. Flip observe↔enforce in the console; the next request picks it up.

TypeScript, everywhere

There's no separate "TypeScript SDK" - TypeScript is the JS runtimes:

| Where your TypeScript runs | Use | |---|---| | Node backend (Express/Fastify/Koa, Next.js API routes) | @nemesis-shield-autogon/sentinel - ships .d.ts types | | Supabase Edge / Deno / CF Workers / Vercel Edge | this package (edge/) | | Browser (React/Angular/Vue/…) | @nemesis-shield-autogon/browser - ships .d.ts types |

Verified

End-to-end (learn → enforce → attack) as a Deno Deno.serve function against production: legit GET /products → 200; auth bypass, BOLA (/orders/999 unauth), path traversal (/etc/passwd) and scanner probes (/wp-login.php, /.env, /phpmyadmin) all blocked (403) and reported (findings=11 medium=6). deno check passes.

Full coverage & safe-unlock

Mount it first / outermost so every route is inspected (not just API routes - attackers hit any path):

Deno.serve(withShield(handler, { token: Deno.env.get("NEMESIS_TOKEN") }));   // wraps the whole function

What's inspected (privacy-preserving): method + normalized route + query-param structure (names + kinds, never values) + auth flag + status. An off-baseline route, param structure, method, or auth state is blocked in enforce mode. Path-traversal segments normalize to {traversal}.

Safe-unlock (break-glass): the login/auth path is never blocked, so a still-learning baseline can't lock you out. Defaults: /login /signin /sign-in /auth /oauth /session /wp-login.php /wp-admin. Override:

export NEMESIS_SHIELD_BOOTSTRAP="/login,/admin,/healthz"

Verify coverage - in observe mode, hit a normal route, a param, and a scanner path, then confirm all three appear in the console (Activity / Behaviors):

curl -s "http://localhost:8080/" >/dev/null
curl -s "http://localhost:8080/search?q=shoes" >/dev/null
curl -s "http://localhost:8080/.env" >/dev/null   # shows up as an off-baseline behavior