npm package: @node-core/doc-kit
Description: <p align="center">   <br />   <a href="https://nodejs.org">     <picture>       <source media="(prefers-color-scheme: dark)" srcset="https://nodejs.org/static/logos/nodejsLight.svg">       <img src="https://nodejs.org/static/logos/nodejsDark.svg" width="2
Latest version: 1.3.3

<p align="center">
  <br />
  <a href="https://nodejs.org">
    <picture>
      <source media="(prefers-color-scheme: dark)" srcset="https://nodejs.org/static/logos/nodejsLight.svg">
      <img src="https://nodejs.org/static/logos/nodejsDark.svg" width="200px" alt="Node.js Logo">
    </picture>
  </a>
</p>

<p align="center">
  <code>@node-core/doc-kit</code> is a tool to generate API documentation of Node.js. <a href="https://github.com/nodejs/node/issues/52343">See this issue</a> for more information.
</p>

<p align="center">
  <a title="MIT License" href="LICENSE">
    <img src="https://img.shields.io/badge/license-MIT-blue" alt="MIT License" />
  </a>
  <a href="https://codecov.io/gh/nodejs/doc-kit" >
    <img src="https://codecov.io/gh/nodejs/doc-kit/graph/badge.svg?token=TZRUKKDICU" alt="Codecov coverage badge"/>
  </a>
  <a title="scorecard" href="https://securityscorecards.dev/viewer/?uri=github.com/nodejs/doc-kit">
    <img src="https://api.securityscorecards.dev/projects/github.com/nodejs/doc-kit/badge" alt="doc-kit scorecard badge" />
  </a>
  <a href="https://www.bestpractices.dev/projects/29">
    <img src="https://www.bestpractices.dev/projects/29/badge" alt="CII Best Practices badge">
  </a>
</p>

## Usage

Local invocation:

```sh
$ npx doc-kit --help
```

```sh
$ node bin/cli.mjs --help
```

```
Usage: @node-core/doc-kit [options] [command]

CLI tool to generate the Node.js API documentation

Options:
  -h, --help          display help for command

Commands:
  generate [options]  Generate API docs
  interactive         Launch guided CLI wizard
  help [command]      display help for command
```

### `generate`

```
Usage: @node-core/doc-kit generate [options]

Generate API docs

Options:
  -i, --input <patterns...>  Input file patterns (glob)
  --ignore [patterns...]     Ignore patterns (comma-separated)
  -o, --output <dir>         Output directory
  -p, --threads <number>      (default: "12")
  -v, --version <semver>     Target Node.js version (default: "v22.14.0")
  -c, --changelog <url>      Changelog URL or path (default: "https://raw.githubusercontent.com/nodejs/node/HEAD/CHANGELOG.md")
  --git-ref <url>            Git ref/commit URL (default: "https://github.com/nodejs/node/tree/HEAD")
  -t, --target [modes...]    Target generator modes (choices: "json-simple", "legacy-html", "legacy-html-all", "man-page", "legacy-json", "legacy-json-all", "addon-verify", "api-links", "orama-db", "llms-txt")
  -h, --help                 display help for command
```

### `interactive`

```
Usage: @node-core/doc-kit interactive [options]

Launch guided CLI wizard

Options:
  -h, --help  display help for command
```

## Examples

### Legacy

To generate a 1:1 match with the [legacy tooling](https://github.com/nodejs/node/tree/main/tools/doc), use the `legacy-html`, `legacy-json`, `legacy-html-all`, and `legacy-json-all` generators.

```sh
npx doc-kit generate \
  -t legacy-html \
  -t legacy-json \
  -i "path/to/node/doc/api/*.md" \
  -o out \
  --index path/to/node/doc/api/index.md
```

### Redesigned

To generate [our redesigned documentation pages](https://nodejs-api-docs-tooling.vercel.app), use the `web` and `orama-db` (for search) generators.

```sh
npx doc-kit generate \
  -t web \
  -t orama-db \
  -i "path/to/node/doc/api/*.md" \
  -o out \
  --index path/to/node/doc/api/index.md
```

> [!TIP]
> In order to use the search functionality, you _must_ serve the output directory.
>
> ```sh
> npx serve out
> ```