The docs toolkit
for APIs.
doc-kit reads your API from Markdown, MDX, TypeScript and JSDoc, and keeps its signatures, typed parameters, stability and history as data. From there it builds a fast, searchable site, JSON, LLMs.txt and anything else a generator can write.
npm i -D @doc-kit/cli @doc-kit/generator-reactDocumenting the JavaScript ecosystem
5B+
requests a month to the Node.js API docs, built with doc-kit
12
built-in generators, from the website to LLMs.txt. Yours is one module
10kB
of gzipped JavaScript up front. Islands load the rest as they hydrate
Performance
Parse once. Build in parallel.
doc-kit parses your docs once and builds every output from that one parse. So JSON, the search index and LLMs.txt add only a little to the time the site takes on its own.
- Works in chunks. The heavy stages split the work across a pool of worker threads, and the site and JSON are written chunk by chunk.
- Runs side by side. Outputs that don't depend on each other run at the same time, all from the same API entries.
- Frees as it goes. A stage's result is dropped once its last reader is done, so memory is reclaimed while the rest of the build runs.
This site, start to finish34 pages · 48,316 words
Median of five clean builds on an AMD Ryzen 9 8945HX (16 cores, 4 worker threads) with Node.js 24.18 and doc-kit ec7751f. How we measured
The Node.js v26.12.1 API docs, start to finish70 files · 574,627 words
Median of three clean builds on an AMD Ryzen 9 8945HX (16 cores, 4 worker threads) with Node.js 24.18 and doc-kit ec7751f. How we measured
One source, many formats
Write it once. Every output agrees.
Document an API in Markdown, where a heading is a signature, a list holds typed parameters and a comment records history. Use MDX for pages that need components, or let the TypeDoc plugin write the Markdown from your TypeScript and JSDoc. doc-kit parses it all once into typed API entries and builds every output from them.
# Kittens
<!--introduced_in=v1.0.0-->
The `kittens` module adopts, feeds, and pets kittens.
## `kittens.adopt(name[, options])`
<!-- YAML
added: v1.0.0
changes:
- version: v2.0.0
pr-url: https://github.com/acme/kittens/pull/42
description: Returns a promise.
-->
> Stability: 1 - Experimental
- `name` {string} The kitten's name.
- `options` {Object}
- `color` {string} Coat color. **Default:** `'tabby'`.
- `signal` {AbortSignal} Cancels the adoption.
- Returns: {Promise} Fulfills with the adopted kitten.
Adopts a kitten, once the paperwork is done./**
* Adopts a kitten, once the paperwork is done.
*
* @param name - The kitten's name.
* @param options.color - Coat color.
* @param options.signal - Cancels the adoption.
* @returns The adopted kitten.
* @experimental
*/
export async function adopt(
name: string,
options: { color?: string; signal?: AbortSignal } = {}
): Promise<Kitten> {
// …
}@doc-kit/typedoc turns this into doc-kit Markdown, with its signature, typed parameters and stability.
/**
* Adopts a kitten, once the paperwork is done.
*
* @param {string} name The kitten's name.
* @param {object} [options]
* @param {string} [options.color] Coat color.
* @param {AbortSignal} [options.signal] Cancels the adoption.
* @returns {Promise<Kitten>} The adopted kitten.
* @experimental
*/
export async function adopt(name, options = {}) {
// …
}Plain JavaScript works too: TypeDoc reads the JSDoc types, and @doc-kit/typedoc writes the Markdown from them.
kittens.adopt
Added in v1.0.0kittens.adopt(name, options?): Promise
Stability: 1 Experimental
name: stringThe kitten's name.
options?: Objectcolor?: stringCoat color. Default: 'tabby'.
signal: AbortSignalCancels the adoption.
Returns: PromiseFulfills with the adopted kitten.
{
"$schema": "https://doc-kit.nodejs.org/schemas/api-doc/1.0.1.json",
"id": "kittens",
"type": "module",
"title": "Kittens",
"introducedIn": "v1.0.0",
"children": [
{
"kind": "method",
"name": "adopt",
"stability": { "index": "1", "description": "Experimental" },
"added": ["v1.0.0"],
"changes": [
{
"versions": ["v2.0.0"],
"prUrl": "https://github.com/acme/kittens/pull/42",
"description": "Returns a promise."
}
],
"signature": {
"parameters": [
{
"name": "name",
"type": {
"text": "string",
"links": [{ "name": "string", "href": "https://developer.mozilla.org/…" }]
},
"description": "The kitten's name.",
"optional": false
},
{ "name": "options", "optional": true, "properties": [ … ] }
],
"returns": {
"type": { "text": "Promise", "links": [ … ] },
"description": "Fulfills with the adopted kitten."
}
}
}
]
}Kittens
adopt
Adopts a kitten, once the paperwork is done.
Its entry in the search index:
{
"title": "adopt",
"description": "Adopts a kitten, once the paperwork is done.",
"href": "/kittens.html#kittensadoptname-options",
"siteSection": "Kittens"
}# Kittens Documentation
> API documentation for Kittens.
…
## API Documentations
- [Kittens](https://kittens.dev/kittens.md): The `kittens` module adopts, feeds, and pets kittens.Features
Made for API reference.
Knows a method when it sees one
Classes, methods, events, properties and constructors are recognized by how you write their headings. Parameters, defaults, return values, stability and history become data, not decoration.
Types that link themselves
Write {string|Buffer} and each type links to its docs, found in your type map first, then on MDN for JavaScript built-ins and Web APIs, then in your own pages.
Static pages, interactive islands
Pages are rendered to static HTML at build time and load 10 kB of gzipped JavaScript up front. The search box, theme switch and sidebar hydrate once the browser is idle, and code blocks the first time you reach for one. Links between pages swap the content in place.
For people and for models
The search index, a sitemap and LLMs.txt, in a short and a full version, come out of the same build as the site. People and models read the same docs.
Make it yours
Swap any part of the page for your own component, use components in MDX, restyle it with CSS or hand Vite your plugins. This site is doc-kit, themed.
TypeScript and JSDoc, too
The experimental @doc-kit/typedoc plugin turns TypeScript and JSDoc-annotated JavaScript into Markdown, so your reference lives next to your guides.
Getting started
Docs in three steps.
1Install
The CLI and the generators that build the site.
npm i -D @doc-kit/cli @doc-kit/generator-react2Write
Markdown, with headings written like signatures and lists like parameters. Or let @doc-kit/typedoc write it from your TypeScript or JSDoc.
# Kittens The `kittens` module adopts, feeds, and pets kittens. ## `kittens.pet(kitten[, times])` - `kitten` {Kitten} The kitten to pet. - `times` {number} **Default:** `1`. - Returns: {boolean} Whether it purred.3Generate
The site and its search index, then a local preview.
$ npx doc-kit generate -t html -t orama-db -i "docs/*.md" -o out $ npx serve out
Built in the open.
doc-kit is an open source project of the Node.js organization, shaped by the people who use it. Bring an issue, an idea, a generator or a pull request.