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

tsdocs-builder

v0.0.4

Published

A CLI tool for generating Markdown documentation from TypeScript source code

Downloads

73

Readme

tsdocs-builder

Build npm version License TypeScript

Generate beautiful Markdown documentation from TypeScript source code — with zero configuration.

tsdocs-builder parses your TypeScript files using ts-morph, extracts JSDoc comments, and emits clean Markdown docs with a ready-to-use sidebar for your documentation framework.


Features

  • TypeScript-first — Understands interfaces, types, classes, enums, functions, and constants
  • JSDoc extraction — Pulls summaries, descriptions, @param, @returns, @example, @deprecated, @internal, @ignore, and custom tags
  • Multi-framework sidebar — Generates sidebar config for Docusaurus, Mintlify, Fumadocs, VitePress, or Neutrino
  • Type linking — Automatically links types across your codebase
  • Module grouping — Organizes exports by file and submodule directory
  • Config file — Load options from a JSON config file; CLI flags override config values
  • Dry-run preview — Preview what would be generated without writing any files
  • Path exclusion — Skip specific folders or files with glob patterns
  • Missing docs flag — Flag exports without JSDoc documentation
  • CLI or library — Use it as a command-line tool or import it as a TypeScript module
  • Bun-native — Built for Bun, works with Node 18+

Quick Start

# Install
npm install -g tsdocs-builder
# or: bun add -g tsdocs-builder

# Run
tsdocs --input ./src --output ./docs

That's it. Your documentation is in ./docs.


Installation

npm (global)

npm install -g tsdocs-builder

npm (local)

npm install tsdocs-builder
npx tsdocs --input ./src --output ./docs

Bun

bun add tsdocs-builder
bun run tsdocs --input ./src --output ./docs

From source

git clone https://github.com/Bravo68Web/tsdocs-builder.git
cd tsdocs-builder
bun install
bun run build
./bin/tsdocs --input ./src --output ./docs

Usage

tsdocs --input ./src --output ./docs [options]

Basic examples

# Default: Docusaurus sidebar
tsdocs --input ./src --output ./docs

# Short flags
tsdocs -i ./src -o ./docs

# Positional arguments (input first, output second)
tsdocs ./src ./docs

# Mintlify sidebar
tsdocs --input ./src --output ./docs --sidebarStyle mintlify

# Skip private members
tsdocs --input ./src --output ./docs --skipPrivate

# Preview what would be generated
tsdocs --input ./src --output ./docs --dryrun

# Skip specific folders
tsdocs --input ./src --output ./docs --ignorePaths "hooks/,tests/"

# Use config file
tsdocs --config ./tsdocs.config.json

Config file

Create a tsdocs.config.json to save your preferred options:

{
 "input": "./src",
 "output": "./docs",
 "baseName": "my-library",
 "skipPrivate": true,
 "skipInternal": true,
 "sidebar": true,
 "sidebarStyle": "docusaurus"
}

Then run with tsdocs --config ./tsdocs.config.json. CLI flags override config values.


CLI Options

| Flag | Short | Default | Description | |------|-------|---------|-------------| | --input <path> | -i | — | Required. Path to TypeScript source files | | --output <path> | -o | — | Required. Output directory for docs | | --baseName <name> | -b | Module name | Base path prefix in sidebar links | | --include <glob>[,<glob>] | — | **/*.ts, **/*.tsx | File patterns to include | | --exclude <glob>[,<glob>] | — | **/*.d.ts, **/*.spec.ts, **/*.test.ts, **/node_modules/** | File patterns to exclude | | --skipPrivate | — | true | Omit private (#) members from docs | | --no-skipPrivate | — | — | Include private members | | --skipDeprecated | — | false | Omit @deprecated members | | --skipInternal | — | false | Omit @internal members | | --ignoreSources | — | false | Skip source location links | | --sidebar | — | true | Generate sidebar config file | | --no-sidebar | — | — | Skip sidebar generation | | --sidebarStyle <style> | — | docusaurus | Sidebar style: docusaurus, mintlify, fumadocs, vitepress, neutrino | | --groupBy <mode> | — | kind | Group exports by: kind, folder | | --sortBy <mode> | — | alphabetical | Sort by: alphabetical, source, category | | --treatAsSingleModule | — | false | Do not create subdirectory per folder | | --config <path> | — | — | Path to options JSON file | | --dryrun | — | false | Preview output without writing files | | --ignorePaths <glob> | — | — | Skip files/folders matching glob patterns (hooks/, **/*.test.ts) | | --showMissingRef | — | false | Flag exports missing JSDoc documentation | | --help | -h | — | Show help | | --version | -V | — | Show version |


Supported Doc Frameworks

| Framework | Sidebar File | Notes | |-----------|--------------|-------| | Docusaurus | _sidebar.json | Default. Nested { label, items } structure | | Mintlify | _meta.json | Per-directory. { title, slug } entries | | Fumadocs | sidebar.json | MDX-safe. { title, link, children } | | VitePress | sidebar.json | Flat. { text, link, items } | | Neutrino | navigation.json | Flattened { text, link } array |

Example: Mintlify

tsdocs --input ./src --output ./docs --sidebarStyle mintlify

Outputs:

docs/
├── _meta.json # Root metadata
├── README.md
├── function.md
├── interface.md
├── ...
└── submodule-name/
 ├── _meta.json # Per-directory metadata
 ├── README.md
 └── ...

Programmatic API

import { TsDocsParser, generateDocs } from "tsdocs-builder";
import type { TsDocsOptions, DocModule } from "tsdocs-builder";

// Low-level: parse and get the DocModule
const opts: TsDocsOptions = {
 input: "./src",
 output: "./docs",
 skipPrivate: true,
 sidebarStyle: "docusaurus",
};

const parser = new TsDocsParser(opts);
const module = parser.parse();

// High-level: parse and write all docs
const module = await generateDocs(opts);

Architecture

src/
├── index.ts # CLI entry + public API
├── core/
│ ├── parser.ts # Orchestrates parsing pipeline
│ ├── extractor.ts # Extracts exports from ts-morph
│ └── jsdoc-parser.ts # Parses JSDoc blocks
├── generators/ # Markdown generators per export kind
│ ├── function-generator.ts
│ ├── interface-generator.ts
│ ├── class-generator.ts
│ ├── enum-generator.ts
│ ├── constant-generator.ts
│ ├── module-readme-generator.ts
│ └── navigation-generator.ts
├── adapters/ # Sidebar format adapters
│ ├── types.ts
│ ├── docusaurus.ts
│ ├── mintlify.ts
│ ├── fumadocs.ts
│ ├── vitepress.ts
│ └── neutrino.ts
├── output/
│ ├── markdown-writer.ts
│ └── file-namer.ts
├── types/
│ └── doc-types.ts # Core document types
└── utils/
 ├── path-utils.ts
 └── config-loader.ts

Parsing flow: index.tsTsDocsParserextractor.ts → JSDoc parsed per-export → Markdown generated per kind → sidebar serialized per adapter.


Contributing

See CONTRIBUTING.md.


License via MIT Licence