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 · Fundamentals · all subjects

running scripts with flags

11 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 basic usage

The deno doc command generates documentation from TypeScript and JavaScript code. Run 'deno doc math.ts' to output documentation to the terminal, showing all exported functions, classes, and interfaces with their JSDoc comments.

deno doc HTML output flag

Use the --html flag with deno doc to create a documentation website. Run 'deno doc --html --name="Math Utilities" math.ts' to generate a static site in the ./docs/ directory. The site includes a searchable interface, syntax highlighting, cross-references between symbols, and mobile-friendly responsive design. Specify a custom output directory with --output flag, e.g., 'deno doc --html --name="Math Utilities" --output=./documentation/ math.ts'.

deno doc --lint documentation linting

Use the --lint flag to check for documentation issues: 'deno doc --lint math.ts'. The linter reports three categories of problems: missing-jsdoc (exported symbol has no JSDoc comment), missing-return-type (exported function has no explicit return type annotation), and private-type-ref (public export references a type that is not itself exported). When --lint finds any errors, the command exits with a non-zero status code.

deno doc JSON output

Generate documentation in JSON format using 'deno doc --json math.ts > documentation.json'. The JSON output provides a low-level representation of your code's structure, including symbol definitions and basic type information. This format is primarily useful for building custom documentation tools or integrating with other systems that need programmatic access to your code's API surface.

deno doc documentation generation output types

deno doc can generate HTML, JSON, or terminal output. No setup is required and it works out of the box. It leverages JSDoc comments for documentation and automatically extracts type information from TypeScript type annotations.

deno doc multiple files

You can document multiple files at once with deno doc: 'deno doc --html --name="My Library" ./mod.ts ./utils.ts ./types.ts'. For larger projects, create a main module file that re-exports everything, then generate documentation from the main module.

JSDoc @example tag in deno doc

Use the @example tag in JSDoc comments to provide concrete code examples. The example will be included in the generated documentation. Code examples should be wrapped in triple backticks with a language specifier (e.g., ```ts).

JSDoc @module tag

Use the @module tag in JSDoc comments to mark module-level documentation. This provides a description of an entire module.

JSDoc @deprecated and @experimental tags

Mark deprecated features with @deprecated followed by a recommendation (e.g., '@deprecated Use newFunction() instead'). Mark experimental features with @experimental followed by a note about potential API changes (e.g., '@experimental This API may change in future versions').

JSDoc best practices for deno doc

Best practices include: (1) Use descriptive summaries that clearly explain functionality, (2) Provide concrete code examples with expected outputs, (3) Document all parameters and return values including @throws for error cases, (4) Use module-level documentation with @module tag, (5) Mark deprecated or experimental features.

deno doc integrates with JSR

If you publish your package to JSR (JavaScript Registry), beautiful documentation is automatically generated for free. JSR uses the same deno doc technology under the hood to create searchable, web-based documentation. Simply publish your well-documented code with 'deno publish' and JSR handles the rest.

Give your agent this brain