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

@opuu/elysia-llms-txt

v1.1.0

Published

Elysia plugin to generate llms.txt from OpenAPI/Swagger specifications.

Readme

Elysia LLMs TXT

An Elysia plugin that generates llms.txt documentation from OpenAPI/Swagger specifications. Transform your API specs into LLM-friendly documentation with automatic endpoint generation.

npm version License: MIT TypeScript Elysia

Why Elysia LLMs TXT?

Elysia LLMs TXT bridges the gap between your API documentation and AI consumption, making it perfect for:

  • LLM Integration: Generate AI-friendly documentation that large language models can easily parse
  • API Documentation: Convert OpenAPI/Swagger specs into readable markdown format
  • Developer Experience: Provide /llms.txt endpoints for instant API documentation access
  • AI Training: Create structured documentation suitable for training AI models on your API
  • Documentation Automation: Automatically generate and serve API documentation without manual maintenance

Key Features

  • OpenAPI/Swagger Support: Works with both file-based and URL-based OpenAPI specifications
  • JSON & YAML Support: Automatically detects and parses both JSON and YAML formats
  • LLM-Optimized Output: Generates markdown documentation specifically formatted for AI consumption
  • Elysia Native: Built specifically for Elysia with TypeScript support
  • Flexible Configuration: Customizable headers, footers, and content types
  • Standard Endpoints: Provides /llms.txt and /llms-full.txt endpoints automatically
  • Built-in Caching: Optional LRU cache with configurable TTL and max size

Installation

npm install @opuu/elysia-llms-txt
pnpm add @opuu/elysia-llms-txt
yarn add @opuu/elysia-llms-txt
bun add @opuu/elysia-llms-txt

Quick Start

1. Basic Usage

import { Elysia } from "elysia";
import { llms } from "@opuu/elysia-llms-txt";

const app = new Elysia()
  .use(
    llms({
      source: {
        type: "url",
        url: "/swagger/json",
      },
    })
  )
  .listen(3000);

// Visit: http://localhost:3000/llms.txt

2. File-based Configuration

import { Elysia } from "elysia";
import { llms } from "@opuu/elysia-llms-txt";

const app = new Elysia()
  .use(
    llms({
      source: {
        type: "file",
        file: "./openapi.json",
      },
      header: "# My API Documentation",
      footer: "Generated for LLM consumption",
    })
  )
  .listen(3000);

3. Advanced Configuration

import { Elysia } from "elysia";
import { llms } from "@opuu/elysia-llms-txt";

const app = new Elysia()
  .use(
    llms({
      source: {
        type: "url",
        url: "https://petstore.swagger.io/v2/swagger.json",
      },
      header: `# Petstore API Documentation
    
This documentation is optimized for Large Language Models.`,
      footer: `
---
Last updated: ${new Date().toISOString()}
Generated by @opuu/elysia-llms-txt`,
      contentType: "text/markdown",
    })
  )
  .listen(3000);

API Reference

Configuration Options

The plugin accepts an LLMsOptions object with the following properties:

| Option | Type | Description | Default | | ------------- | --------------------------------- | ------------------------------------- | ----------------- | | source | object | Source configuration for OpenAPI spec | Required | | source.type | "file" \| "url" | Whether to load from file or URL | Required | | source.file | string | File path (when type is "file") | Optional | | source.url | string | URL path (when type is "url") | Optional | | header | string | Optional header content | Optional | | footer | string | Optional footer content | Optional | | contentType | "text/markdown" \| "text/plain" | Response content type | "text/markdown" | | cache | object | Cache configuration | Optional | | cache.enabled | boolean | Enable response caching | false | | cache.ttl | number | Cache TTL in milliseconds | 60000 | | cache.maxSize | number | Max cache entries (LRU eviction) | 100 |

YAML Support

The plugin automatically detects and parses YAML OpenAPI specs. To enable YAML support, install js-yaml:

npm install js-yaml

YAML files are detected by:

  1. File extension (.yaml or .yml)
  2. Content analysis (if not starting with { or [)

Generated Endpoints

The plugin automatically adds these endpoints to your Elysia application:

  • GET /llms.txt - Returns the generated LLM documentation
  • GET /llms-full.txt - Redirects to /llms.txt (for compatibility)

Requirements

  • Node.js >= 18.0.0
  • Bun >= 1.0.0
  • Elysia >= 1.0.0

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.