new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Deno · Reference · all subjects

cli commands/doc

9 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

deno doc example output

Running `deno doc add.ts` with a file containing an exported `add` function with JSDoc comments produces output like: `function add(x: number, y: number): number` followed by the JSDoc comment text on the next line.

deno doc command basic usage

The `deno doc` command followed by one or more source files prints the JSDoc documentation for each module's exported members to stdout.

deno doc --lint flag

The `--lint` flag checks for problems in documentation while it is being generated. It reports three types of errors: (1) an exported type from the root module referencing a non-exported type, (2) missing return type or property type on a public type, and (3) missing JSDoc comment on a public type. If any problems are found, the program exits with non-zero exit code and output is reported to standard error. Errors can be suppressed using `@internal` jsdoc tag for export issues, and `@ignore` jsdoc tag to exclude from documentation or `@internal` to keep in docs but signify it's internal.

deno doc --html flag

The `--html` flag generates a static site with documentation. Use `deno doc --html --name="My library" ./mod.ts` to generate documentation. The `--output` flag can specify the output directory, e.g., `deno doc --html --name="My library" --output=./documentation/ ./mod.ts`. Multiple files can be documented together with `deno doc --html --name="My library" ./sub1/mod.ts ./sub2/mod.ts`. The generated documentation is a static site with multiple pages that can be deployed to any static site hosting service. A client-side search is included in the generated site but is not available if the user's browser has JavaScript disabled.

deno doc --json flag

The `--json` flag outputs the documentation in JSON format. This JSON format is consumed by the deno doc website (https://github.com/denoland/docland) and is used to generate module documentation.

deno doc npm and jsr specifiers

Starting in Deno 2.8, `deno doc` accepts `npm:` and `jsr:` specifiers and will fetch the package's published types before generating documentation. You can use `deno doc npm:code-block-writer` or `deno doc jsr:@std/path` to explore third-party APIs from the terminal without cloning the repository. You can pin to a specific version like any other Deno specifier (e.g., `npm:zod@4`) and combine the specifier with `--html` or `--json` to render the same output formats as for local files.

JSDoc tags supported by deno doc

Deno doc supports the following JSDoc tags: `constructor`/`class`, `ignore`, `internal`, `public`, `private`, `protected`, `readonly`, `experimental`, `deprecated`, `module`, `category`/`group`, `see`, `example`, `tags`, `since`, `callback`, `template`/`typeparam`/`typeParam`, `prop`/`property`, `typedef`, `param`/`arg`/`argument`, `return`/`returns`, `throws`/`exception`, `enum`, `extends`/`augments`, `this`, `type`, and `default`. Code examples in `@example` tags need to be wrapped in triple backticks (markdown-style codeblocks). All free-form text places accept markdown.

deno doc inline linking syntax

JSDoc style inline-links are supported in `deno doc`. Use `{@link https://docs.deno.com}` to create a link. Use `{@linkcode https://docs.deno.com}` to render the link in monospace font. You can specify replacement text with `{@link https://docs.deno.com | Deno Docs}` to display custom text instead of the link. For symbol links, use `{@link MySymbol}` for the current module or `{@link [myModule].mysymbol}` for symbols in different modules. For module linking, use `{@link [myModule]}` syntax.

deno doc command

deno doc is used to generate documentation for a module.

Give your agent this brain