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

@citelens/middleware

v0.1.4

Published

Serve your CiteLens-hosted llms.txt and llms-full.txt natively in Next.js. No redirects.

Readme

@citelens/middleware

Serve your CiteLens-hosted llms.txt and llms-full.txt natively in Next.js. No redirects. No vercel.json changes. Files appear to live on your domain and update automatically.

What is llms.txt?

llms.txt is the emerging standard for making websites readable by AI systems like ChatGPT, Claude, and Perplexity. It tells AI crawlers exactly what your site does and where your best content lives.

CiteLens generates, hosts, and maintains your llms.txt automatically. This middleware package serves it natively from your domain.

Quick start (recommended)

From your Next.js project root, run the setup CLI. It verifies your llms.txt is hosted on CiteLens, installs the package, and writes middleware.ts for you:

npx citelens-setup

You'll be prompted for your domain. That's it. Deploy and your files are live.

Installation (manual)

If you'd rather wire it up yourself:

npm install @citelens/middleware

Setup

Create or update middleware.ts at your project root:

import { citeLensMiddleware } from '@citelens/middleware'

export default citeLensMiddleware({
  domain: 'yourdomain.com'
})

export const config = {
  matcher: ['/llms.txt', '/llms-full.txt']
}

Deploy and your files are live at:

  • yourdomain.com/llms.txt
  • yourdomain.com/llms-full.txt

Configuration

citeLensMiddleware({
  // Required: your domain without protocol
  domain: 'yourdomain.com',

  // Optional: cache duration in seconds (default: 3600)
  cacheDuration: 3600,
})

How it works

The middleware intercepts requests to /llms.txt and /llms-full.txt and serves the latest content from CiteLens servers. The files appear to live natively on your domain with no visible redirect.

CiteLens regenerates your files every Monday based on your latest site content. You never need to touch them again.

Requirements

  • Next.js 14 or later
  • A CiteLens account with generated llms.txt files

Generate yours free at citelens.dev

If you have an existing middleware.ts

Compose with your existing middleware:

import { citeLensMiddleware } from '@citelens/middleware'
import { NextResponse } from 'next/server'
import type { NextRequest } from 'next/server'

const handleCiteLens = citeLensMiddleware({
  domain: 'yourdomain.com'
})

export async function middleware(request: NextRequest) {
  // Handle llms.txt files first
  if (
    request.nextUrl.pathname === '/llms.txt' ||
    request.nextUrl.pathname === '/llms-full.txt'
  ) {
    return handleCiteLens(request)
  }

  // Your existing middleware logic here
  return NextResponse.next()
}

export const config = {
  matcher: [
    '/llms.txt',
    '/llms-full.txt',
    // your other matchers
  ]
}

License

MIT

Links

  • Generate your llms.txt: https://citelens.dev
  • Setup guide: https://citelens.dev/setup/llms-txt
  • Support: [email protected]