ende doc
Examples
ende doc followed by a list of one or more source files will print the JSDoc
documentation for each of the module's exported members.
For example, given a file add.ts with the contents:
/**
* Adds x and y.
* @param {number} x
* @param {number} y
* @returns {number} Sum of x and y
*/
export function add(x: number, y: number): number {
return x + y;
}
Running the Ende doc command prints the function's JSDoc comment to stdout:
ende doc add.ts
function add(x: number, y: number): number
Adds x and y. @param {number} x @param {number} y @returns {number} Sum of x and y
Documenting a JSR package
ende doc accepts jsr: specifiers and will fetch the package's published
types before generating documentation. This is useful for exploring a
third-party API from the terminal without cloning the repository:
ende doc jsr:@ende/path
You can pin to a specific version like any other Ende specifier
(jsr:@ende/[email protected]), and combine the specifier with --html or
--json to render the same output formats as for local files.
Linting
You can use --lint flag to check for problems in your documentation while it's
being generated. ende doc will point out three kinds of problems:
- Error for an exported type from the root module referencing a non-exported
type.
- Ensures API consumers have access to all the types the API uses. This can
be suppressed by exporting the type from a root module (one of the files
specified to
ende docon the command line) or by marking the type with an@internaljsdoc tag.
- Ensures API consumers have access to all the types the API uses. This can
be suppressed by exporting the type from a root module (one of the files
specified to
- Error for missing return type or property type on a public type.
- Ensures
ende docdisplays the return/property type and helps improve type checking performance.
- Ensures
- Error for missing JS doc comment on a public type.
- Ensures the code is documented. Can be suppressed by adding a jsdoc
comment, or via an
@ignorejsdoc tag to exclude it from the documentation. Alternatively, add an@internaltag to keep it in the docs, but signify it's internal.
- Ensures the code is documented. Can be suppressed by adding a jsdoc
comment, or via an
For example:
interface Person {
name: string;
// ...
}
export function getName(person: Person) {
return person.name;
}ende doc --lint mod.ts
Type 'getName' references type 'Person' which is not exported from a root module.
Missing JS documentation comment.
Missing return type.
at file:///mod.ts:6:1
These lints are meant to help you write better documentation and speed up type-checking in your projects. If any problems are found, the program exits with non-zero exit code and the output is reported to standard error.
Supported JSDoc features and tags
Ende implements a large set of JSDoc tags, but does not strictly adhere to the JSDoc standard, but rather align with sensible standards and features provided by widely used tools and ecosystems in the same feature-space, like TSDoc and TypeDoc.
For any free-form text places, ie the main description of a JSDoc comment, the description of a parameter, etc. accept markdown.
Supported Tags
The following tags are supported, being a selection of tags used and specified by JSDoc, TSDoc and TypeDoc:
constructor/class: mark a function to be a constructor.ignore: ignore a symbol to be included in the output.- internal: mark a symbol to be used only for internal. In the HTML generator, the symbol will not get a listed entry, however it will still be generated and can be reached if a non-internal symbol links to it.
public: treat a symbol as public API. Equivalent of TypeScriptpublickeyword.private: treat a symbol as private API. Equivalent of TypeScriptprivatekeyword.protected: treat a property or method as protected API. Equivalent of TypeScriptprotectedkeyword.readonly: mark a symbol to be readonly, meaning that it cannot be overwritten.experimental: mark a symbol as experimental, meaning that the API might change or be removed, or behaviour is not well-defined.deprecated: mark a symbol as deprecated, meaning that it is not supported anymore and might be removed in a future version.module: this tag can be defined on a top-level JSDoc comment, which will treat that comment to be for the file instead of the subsequent symbol. A value can be specified, which will use the value as an identifier for the module (ie for default exports).category/group: mark a symbol to be of a specific category/group. This is useful for grouping together various symbols together.see: define an external reference related to the symbol.example: define an example for the symbol. Unlike JSDoc, code examples need to be wrapped in triple backtick (markdown-style codeblocks), which aligns more with TSDoc than JSDoc.tags: define additional custom labels for a symbol, via a comma separated list.since: define since when the symbol has been available.callback: define a callback.template/typeparam/typeParam: define a generic parameter.prop/property: define a property on a symbol.typedef: define a type.param/arg/argument: define a parameter on a function.return/returns: define the return type and/or comment of a function.throws/exception: define what a function throws when called.enum: define an object to be an enum.extends/augments: define a type that a function extends on.this: define what thethiskeyword refers to in a function.type: define the type of a symbol.default: define the default value for a variable, property or field.
Inline Linking
Inline links let you specify links to other parts of the page, other symbols, or modules. Besides just supporting markdown-style links, JSDoc style inline-links are also supported.
For example, you can do{@link https://docs.ende.sh}, which will be rendered as
the following 'https://docs.ende.sh'. {@linkcode https://docs.ende.sh} can
also be used, to make it in a monospace font, and will be rendered roughly like
this: 'https://docs.ende.sh'.
You can also specify a replacement label, via
{@link https://docs.ende.sh | Ende Docs}, which will use the text after | as
the text to display instead of the link. The previous example would render as
'Ende Docs'.
You can add inline links in your descriptions to other symbols via
{@link MySymbol}.
For module linking, the same applies, but you use the {@link [myModule]}
syntax. You can also link to symbols in a different module via
{@link [myModule].mysymbol}.
HTML output
Use the --html flag to generate a static site with documentation.
ende doc --html --name="My library" ./mod.ts
ende doc --html --name="My library" --output=./documentation/ ./mod.ts
ende 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 user's browser has JavaScript disabled.
JSON output
Use the --json flag to output the documentation in JSON format. This JSON
format is consumed by the
ende doc website and is used to generate
module documentation.
Command line usage:
docGenerate and show documentation for a module or built-ins
Options
--allow-import, -I
Allow importing from remote hosts. Optionally specify allowed IP addresses and host names, with ports as necessary. Default value: deno.land:443,jsr.io:443,esm.sh:443,raw.esm.sh:443,cdn.jsdelivr.net:443,raw.githubusercontent.com:443,gist.githubusercontent.com:443.
--builtin
--category-docs
Path to a JSON file keyed by category and an optional value of a markdown doc.
--cert
Load certificate authority from PEM encoded file.
--config, -c
Configure different aspects of ende including TypeScript, linting, and code formatting.
Typically the configuration file will be called ende.json or ende.jsonc and
automatically detected; in that case this flag is not necessary.
--default-symbol-map
Uses the provided mapping of default name to wanted name for usage blocks.
--deny-import
Deny importing from remote hosts. Optionally specify denied IP addresses and host names, with ports as necessary.
--filter
Dot separated path to symbol.
--frozen-lockfile
Error out if lockfile is out of date.
--html
Output documentation in HTML format.
--import-map
Load import map file from local file or remote URL.
--json
Output documentation in JSON format.
--lint
Output documentation diagnostics.
--lock
Check the specified lock file. (If value is not provided, defaults to "./ende.lock").
--min-dep-age
(Unstable) The age in minutes, ISO-8601 duration or RFC3339 absolute timestamp (e.g. '120' for two hours, 'P2D' for two days, '2025-09-16' for cutoff date, '2025-09-16T12:00:00+00:00' for cutoff time, '0' to disable).
--name
The name that will be used in the docs (ie for breadcrumbs).
--no-check
Skip type-checking. If the value of "remote" is supplied, diagnostic errors from remote modules will be ignored.
--no-config
Disable automatic loading of the configuration file.
--no-lock
Disable auto discovery of the lock file.
--no-remote
Do not resolve remote modules.
--output
Directory for HTML documentation output.
--private
Output private documentation.
--reload, -r
Reload source code cache (recompile TypeScript). With no value, reloads everything. Pass a comma-separated list of specifiers to reload only those modules; jsr:@ende/http/file-server,jsr:@ende/assert/equals reloads specific modules.
--strip-trailing-html
Remove trailing .html from various links. Will still generate files with a .html extension.
--symbol-redirect-map
Path to a JSON file keyed by file, with an inner map of symbol to an external link.
--unsafely-ignore-certificate-errors
DANGER: Disables verification of TLS certificates.
--vendor
Toggles local vendor folder usage for remote modules.