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

@arraypress/llms-txt-astro

v2.0.0

Published

/llms.txt for Astro — an idiomatic route helper plus the builder behind it. Generates and parses the llms.txt AI-discovery format. Zero dependencies.

Readme

@arraypress/llms-txt-astro

An idiomatic /llms.txt route for Astro, plus the build() generator behind it. Returns a Response, with the site origin resolved for you.

Install

npm install @arraypress/llms-txt-astro

Usage

Drop a file at src/pages/llms.txt.ts. Astro serves it at /llms.txt and prerenders it with the rest of a static build.

import { llmsTxtRoute } from '@arraypress/llms-txt-astro';
import { posts } from '../data/posts';

export const GET = llmsTxtRoute((origin) => ({
  name: 'My Site',
  description: 'What this site is, in one line.',
  sections: [
    {
      title: 'Writing',
      links: posts.map((p) => ({ label: p.title, url: `${origin}/${p.slug}` })),
    },
  ],
}));

For a file with no absolute URLs, pass the options directly:

export const GET = llmsTxtRoute({ name: 'My Site', description: 'One line.' });

API

llmsTxtRoute(options)

Returns an Astro APIRoute serving text/plain.

options is either a build() options object, or a factory (origin, context) => options — sync or async. The factory form is the usual one, since the spec wants absolute URLs and the origin isn't known until the request.

originOf(context)

The resolved origin, no trailing slash. Prefers Astro's configured site; falls back to the request URL's origin when site is unset, so astro dev emits usable links instead of undefined/…. Exported because a page occasionally needs the same value.

Why a separate package?

@arraypress/llms-txt is zero-dependency and runs anywhere. This package adds the two things every Astro site otherwise reimplements — resolving Astro.site down to a bare origin, and wrapping the result in a Response — without pulling Astro into the core library.

License

MIT