@lacspace/llms-txt
v1.2.1
Published
Generate and parse llms.txt and llms-full.txt (the llmstxt.org standard) — a Markdown map of your site for LLMs. Zero-dependency, isomorphic.
Maintainers
Readme
@lacspace/llms-txt
Generate & parse llms.txt and llms-full.txt — the llmstxt.org standard.
llms.txtis a Markdown file at your site root that gives LLMs a curated map of your most useful pages;llms-full.txtinlines the full content so a model can read everything in one request. This builds (and parses) both — the SEO layer for the AI era.
- 📄
llmsTxt()— H1 title, blockquote summary, linked sections - 📚
llmsFullTxt()— full content inlined for one-shot ingestion - 🔁
parseLlmsTxt()— read an existing file back into structured data - ⚡ Zero dependencies · 🌍 isomorphic · 📦 ESM + CJS · fully typed
Install
npm install @lacspace/llms-txt # or pnpm add / yarn add / bun addGenerate llms.txt
import { llmsTxt } from "@lacspace/llms-txt";
const txt = llmsTxt({
title: "Lacspace",
summary: "Open-source TypeScript packages and products.",
details: "Zero-dependency, isomorphic, Lacspace-Free-Licensed.",
sections: [
{
title: "Docs",
links: [
{ title: "npm Packages", url: "https://lacspace.com/packages", notes: "20 packages" },
{ title: "SDK", url: "https://www.npmjs.com/package/@lacspace/sdk" },
],
},
],
});# Lacspace
> Open-source TypeScript packages and products.
Zero-dependency, isomorphic, Lacspace-Free-Licensed.
## Docs
- [npm Packages](https://lacspace.com/packages): 20 packages
- [SDK](https://www.npmjs.com/package/@lacspace/sdk)Generate llms-full.txt
import { llmsFullTxt } from "@lacspace/llms-txt";
llmsFullTxt({
title: "Lacspace Docs",
sections: [
{ title: "Getting started", url: "https://lacspace.com/docs", content: "# Getting started\n\nInstall with npm…" },
],
});Parse
import { parseLlmsTxt } from "@lacspace/llms-txt";
const doc = parseLlmsTxt(existing); // { title, summary, details, sections: [{ title, links }] }Serve
llmsTxt(...)at/llms.txtandllmsFullTxt(...)at/llms-full.txt(e.g. from a Next.js Route Handler or any static build step).
The Lacspace SEO Kit
| Package | For |
| --- | --- |
| @lacspace/seo | Metadata & JSON-LD |
| @lacspace/sitemap | sitemap.xml |
| @lacspace/robots | robots.txt |
| @lacspace/llms-txt | llms.txt / llms-full.txt (this package) |
| @lacspace/site-verify | Search-engine verification |
| @lacspace/rss | RSS / Atom / JSON feeds |
| @lacspace/slugify | SEO URL slugs |
New in 1.2 — build from your sitemap
import { llmsTxtFromSitemap } from "@lacspace/llms-txt";
// Feed the same URL list your sitemap uses; sections + titles are derived
const txt = llmsTxtFromSitemap(
[
{ url: "https://x.com/", section: "Main" },
{ url: "https://x.com/docs/sdk", section: "Docs", title: "SDK" },
],
{ title: "Lacspace", summary: "Open-source packages & products." },
);New in 1.1 — Response helpers
import { llmsTxtResponse, llmsFullTxtResponse } from "@lacspace/llms-txt";
// app/llms.txt/route.ts — served as text/plain
export function GET() {
return llmsTxtResponse({ title: "Lacspace", summary: "…", sections });
}Licensing
This package is free under the Lacspace Free Licence — MIT-equivalent freedoms. Use it in personal and commercial projects at no cost; just keep the notice.
Not every Lacspace package is free. We also offer Commercial (paid), Client-specific, and Private (proprietary) packages under separate terms. See the full Lacspace Licence Centre.
Part of the Lacspace ecosystem — 35 zero-dependency, isomorphic TypeScript packages.
