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

@dualmark/netlify

v0.10.0

Published

Netlify Edge Functions adapter for the Dualmark AEO framework. Wraps context.next() and transparently serves markdown to AI bots.

Readme

@dualmark/netlify

Netlify Edge Functions adapter for the Dualmark AEO framework. Wraps context.next() and transparently serves pre-built markdown to AI bots — no changes to your existing site.

Install

bun add @dualmark/netlify @dualmark/core

Usage

Create a Netlify Edge Function that runs on all paths:

// netlify/edge-functions/aeo.ts
import { createAEOWorker } from "@dualmark/netlify";

export default createAEOWorker({
  redirects: {
    internal: { "/old-path": "/new-path" },
    external: { "/login": "https://app.example.com" },
  },

  trailingSlash: "never",

  hooks: {
    onAIRequest: (info) => console.log(`${info.botName} hit ${info.pathname}`),
    onMiss: (info) => console.warn(`miss: ${info.pathname}`),
  },
});

export const config = { path: "/*" };

Deploy to Netlify

Add the edge function routing to your netlify.toml to ensure it runs before your static assets are served:

[[edge_functions]]
  function = "aeo"
  path = "/*"

Then, build your markdown and HTML files using your framework's standard build command before deploying. For example:

bun run build
netlify deploy --prod

How it works

The adapter sits at the edge and intercepts every incoming request:

  1. Trailing-slash enforcement (configurable: never, always, preserve)
  2. AI bot detection via User-Agent (GPTBot, ClaudeBot, PerplexityBot, etc.)
  3. Content negotiation via Accept: text/markdown
  4. Serves pre-built .md from static assets with full AEO headers
  5. Internal redirects: routes to the target path's .md
  6. External redirects: returns a markdown notice pointing to the external URL
  7. 406 when neither HTML nor markdown is acceptable
  8. Link header injection (<…>; rel="alternate"; type="text/markdown") on HTML responses to non-bot clients
  9. HooksonAIRequest and onMiss for custom analytics or logging
  10. Falls through to context.next() for everything else

Asset resolution

The adapter fetches .md files using fetch(), which in Netlify's Deno runtime resolves same-origin paths against the site's deployed static files. Place your markdown files alongside your HTML output:

dist/
  blog/
    hello-world.html   ← served to browsers
    hello-world.md     ← served to AI bots
  index.html
  index.md

Options

| Option | Type | Default | Description | |---|---|---|---| | assets | AssetsFetcher | fetch | Custom fetcher for .md files (useful for testing) | | redirects.internal | Record<string, string> | {} | Internal path remaps | | redirects.external | Record<string, string> | {} | External URL redirects | | skip.prefixes | string[] | ["/admin", "/api/", "/_"] | Paths to bypass | | skip.extensions | string[] | .js, .css, .png, … | Extensions to bypass | | trailingSlash | "never" \| "always" \| "preserve" | "never" | Slash policy | | headers.cacheControl | string | "public, max-age=3600" | Cache-Control on markdown responses | | hooks.onAIRequest | (info) => void | — | Called on every markdown hit | | hooks.onMiss | (info) => void | — | Called when no .md found for a bot | | enableLinkHeader | boolean | true | Inject Link alternate header on HTML |

License

Apache 2.0