/** docgenjs → md
symbols 0 params 0 returns typed 0 score 0
paste · parse · publish

Drop in a
JavaScript file.
Ship an API reference.

A dependency-free parser that reads declarations, arrow functions, classes and object members, then merges @jsdoc tags, TypeScript annotations and inferred types into one GitHub-flavoured reference — with a lint pass that tells you what you forgot to document.

pipeline

  1. scan mask strings, comments, regex literals
  2. parse function · arrow · class · member
  3. resolve jsdoc ⊕ ts types ⊕ inference
  4. emit markdown + usage examples + lint
01 · source
file
1
0 lines · 0 chars · drop a file anywhere ⌘/Ctrl+↵
title
§01

How to use it

Four moves, start to finish. Every step has a button that loads a real snippet so you can watch the output change.

01

Paste, drop or browse

Drop any .js / .mjs / .ts file onto the editor, or pick one from disk. The parser handles function declarations, arrow and function expressions, class members (including getters, setters, statics and generators), object-literal members and export forms.

input · utils.jsexcerpt
02

Let it resolve the types

Types are resolved in priority order: @param {T} / @returns {T} tags first, then TypeScript annotations such as (size: number = 2), then inference from defaults and return expressions. Every type is labelled with where it came from, so you never mistake a guess for a fact.

output · resolved typesmarkdown
| Name | Type | Source | Attributes |
| ---- | ---- | ------ | ---------- |
| `shape` | `Circle \| Rect` | jsdoc | required |
| `size` | `number` | inferred from default `2` | default `2` |
| `deep` | `boolean` | inferred from default `false` | default `false` |
03

Switch to the lint tab

The lint pass is what eslint-plugin-jsdoc would complain about: missing blocks, untyped parameters, summaries that aren't imperative sentences, undocumented @returns and @throws, plus “more than four parameters — use an options object”. The score is weighted: description 40, parameter types 20, parameter prose 15, returns 15, example 10.

lint reportlegacy.js
slugify(text)
  error  no JSDoc block found — add a summary, @param and @returns
  warn   parameter `text` has no type
  warn   return value is undocumented (inferred: string)
  hint   no @example — one runnable snippet beats three paragraphs
04

Copy or download

Copy the markdown straight into a PR body, or download <title>.md and commit it next to the source. The output is plain GitHub-flavoured markdown — tables, fenced js blocks, anchor links — so it renders identically on GitHub, in VitePress, or inside a README.

output · generatedapi-reference.md
## `apiClient.get(path, query)`

Fetch a JSON resource.

**Kind** `async method` · **In** `ApiClient` · **Source** `api-client.js:41`

### Returns

**`Promise<Object>`** — The parsed response body.

### Throws

- **`ApiError`** — If the request fails or the API returns 4xx/5xx.
§02

Field notes: what good API docs do

Distilled from MDN's reference grammar, the JSDoc/TSDoc tag specs, the NumPy docstring standard and the READMEs below. The generator's output shape follows these rules on purpose.

01
Docs live next to the codeOne source of truth. Hand-written mirrors of an API always rot; generate the reference from the same file you edit, in the same PR. Everything in this tool's output is derived from the pasted source.
02
First line is a contractOne imperative sentence, ≤ 80 chars, ending in a period: “Returns…”, “Creates…”, not “This function will return…”. It becomes the summary in tooltips, search results and TOCs.
03
Name, type and meaning for every parameterA type alone is not documentation. Mark optional, defaults, rest args and nullability explicitly — MDN's parameter tables do exactly this and it's why they're skimmable.
04
Document what comes backReturn type, plus the units, the empty case, and whether the value is a copy or a shared reference. For promises, document the resolved value, not just Promise.
05
One runnable example minimumInput → output, imports included, no … hand-waving. Lodash and Chalk built entire reputations on copy-pasteable snippets.
06
Name the failure modesList every @throws with the exact error class and the condition that triggers it. Silent error paths are the #1 support cost in OSS.
07
Fixed section order everywhereSummary → params → returns → throws → examples → notes. Readers build a mental map once and reuse it. NumPy's style guide is the clearest example of this discipline.
08
Explain the why, not just the whatWhen to use it, when not to, complexity, side effects, mutability, async-ness. Type signatures answer “does this compile”; docs answer “is this correct”.
09
Make it machine-checkableLint docs in CI (eslint-plugin-jsdoc, jsdoc -X, remark-lint) and fail the build on regressions. A coverage score you can watch go up is worth ten style guides.
10
Deprecate loudly@deprecated with the replacement and the removal version, every time. Never let a signature change silently.
§03

Repos worth stealing from

Open-source projects whose documentation is a reference implementation of the rules above — and the one habit to copy from each.

ProjectWhere the docs liveSteal this
lodash/lodashJSDoc per method, docs/ generatedEvery method carries an @since, a category, and a dozen example lines showing input → output. The example is the spec. Also: consistent @param {Array} array phrasing across 300+ functions.
ramda/ramdaJSDoc + transpiled type sigsPseudo-type signatures (R.curry(f, n, …)) that communicate currying better than prose ever could. Type-first, then one terse example.
reduxjs/reduxJSDoc on public API + separate guidesReference docs state the contract; the guide explains the concept. Never mix the two in one file. createStore's docblock is a model of param-by-param clarity.
expressjs/expressGuide site with per-method pagesSignature line first (app.METHOD(path, callback)), then a minimal runnable snippet per variant. HTTP semantics documented as a table of statuses.
vuejs/core.d.ts + VitePress API referenceUniform “Type:” / “Detailed:” blocks and option tables with defaults inline. Types are the source of truth; prose only adds what types can't say.
colinhacks/zodInline JSDoc that powers autocompleteDoc comments written for the editor tooltip, not just the website — one summary line + a link to the deep docs. Docs that earn their keep inside the IDE.
mrdoob/three.jsdocs/api/ + editable live examplesEvery reference page has a live example you can change and run. Docs as a test fixture, not a screenshot.
d3/d3README-as-reference, Observable notebooksDocs embedded in the repo README with a rendered example beside each function. Zero friction between reading and trying.
microsoft/tsdocA spec for doc commentsDefine the tag vocabulary before writing docs. TSDoc exists because teams kept inventing incompatible tags — pick a grammar and enforce it.
numpy/numpy pythonDocstring convention docThe section grammar this tool copies: Summary · Parameters · Returns · Raises · See Also · Examples. Language-agnostic best structure, full stop.
octokit/octokit.jsGenerated from the OpenAPI specWhen a machine-readable spec exists, generate the docs from it — never hand-write what a generator can emit.
chalk/chalkREADME“Results” blocks: the snippet and its rendered output stacked. Cheap to write, extremely fast to read.