How to document your JavaScript package
JSDoc comments let package authors write reference documentation alongside code that renders in editor tooltips, `deno doc` output and JSR package pages. Best practices: keep the first paragraph a concise summary because it drives autocomplete and search, add TypeScript types, and use `@param`, `@returns`, `@example` and `@module` tags. Document every exported symbol, including class and interface members, and use markdown and `@link`/`@linkcode` for internal cross-references. Docs-driven development helps keep comments in sync with code changes.
Related posts
- Deno 1.38: HTML doc generator and HMR
Deno mediumAdeptDeno 1.38 adds `deno doc --html` for generating static, rustdoc-style documentation sites, with multi-entrypoint support, a Rust symbol graph and a `--lint` mode that flags missing docs, missing return types and unexported types. Other additions are an unstable `--unstable-hmr` hot module replacement that patches modules in place, bring-your-own npm/pnpm `node_modules` support, `--env` for loading .env files, and RFC 8441 WebSockets over HTTP/2. A new precompile JSX transform serializes static HTML into string arrays at compile time instead of allocating objects per element, giving 7-20x faster server-side rendering and about 50% less GC time. The release also includes V8 12.0 and a faster `structuredClone`.
- Introducing JSR - the JavaScript Registry
Deno mediumAdeptJSR, the JavaScript Registry, is in public beta as a free, MIT-licensed, ESM-only registry built for TypeScript that works with Deno and npm-based runtimes like Node, Bun and Cloudflare Workers. Authors publish TypeScript source directly, and JSR generates API docs, .d.ts files and transpiled JavaScript for Node consumers. A walkthrough publishes a small package with jsr.json, consumes it from an Astro project via `npx jsr add`, and sets up GitHub Actions publishing with OIDC tokens and provenance transparency logs. Packages also get a quality score based on documentation, fast-type-checkable declarations and runtime compatibility.
- Fresh 1.1 - automatic JSX, plugins, DevTools, and more
Deno mediumAdeptFresh 1.1, Deno's zero-client-JS, no-build-step web framework, switches new projects to automatic JSX via the deno.json jsxImportSource setting. It also adds a first plugin system for injecting styles and scripts, with an official Twind plugin that drops the tw wrapper, plus Preact Signals and Preact DevTools support. Route handlers can call ctx.renderNotFound(), and middleware files can export an array of stacked handlers. Experimental Deno.serve support is opt-in via experimentalDenoServe. An update script with codemods migrates existing projects.
- Deno 1.42: Better dependency management with JSR
Deno mediumAdeptDeno 1.42 adds first-class JSR support through new `deno publish` and `deno add` subcommands, which install packages from JSR and npm and write import map entries. It also adds LSP completions for jsr: specifiers and broadens Node compatibility across crypto, worker_threads, fs, http2 and other modules. Further changes include shell improvements in `deno task` (cross-platform shebangs, `$?`, redirects), `deno lint --fix`, and dropping mid-execution type checking under `--check`. Timers were rewritten so creating a million timers takes 1.4s instead of 5.9s with up to 70% less memory, startup is 10% faster on Linux, and `DENO_FUTURE=1` previews Deno 2 removals.
- Node just added TypeScript support. What does that mean for Deno?
Deno easyNoviceNode 22.6 added TypeScript execution via type stripping (stable in 23.6), which replaces annotations with whitespace but does no type checking, does not handle JSX/TSX, and still relies on tsc and a manually managed tsconfig.json. Deno instead ships an integrated toolchain: SWC strips types, a bundled TypeScript compiler powers `deno check` and the LSP, and fmt, lint, doc and compile all understand TypeScript with zero-config defaults. Deno also supports TSX/JSX, TypeScript in the REPL and Jupyter, and publishing raw TypeScript to JSR without transpilation or separate .d.ts files.