node/tools/doc
Bart Louwers 746b17e1a5
Some checks failed
Coverage Linux (without intl) / coverage-linux-without-intl (push) Waiting to run
Coverage Linux / coverage-linux (push) Waiting to run
Coverage Windows / coverage-windows (push) Waiting to run
Test and upload documentation to artifacts / build-docs (push) Waiting to run
Linters / lint-addon-docs (push) Waiting to run
Linters / lint-cpp (push) Waiting to run
Linters / format-cpp (push) Waiting to run
Linters / lint-js-and-md (push) Waiting to run
Linters / lint-py (push) Waiting to run
Linters / lint-yaml (push) Waiting to run
Linters / lint-sh (push) Waiting to run
Linters / lint-codeowners (push) Waiting to run
Linters / lint-pr-url (push) Waiting to run
Linters / lint-readme (push) Waiting to run
Notify on Push / Notify on Force Push on `main` (push) Waiting to run
Notify on Push / Notify on Push on `main` that lacks metadata (push) Waiting to run
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
Find inactive TSC voting members / find (push) Has been cancelled
sqlite: add support for SQLite Session Extension
PR-URL: https://github.com/nodejs/node/pull/54181
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2024-11-18 00:57:04 +00:00
..
addon-verify.mjs tools: update ESLint to 9.14.0 2024-11-06 00:37:39 +01:00
allhtml.mjs doc: add main ARIA landmark to API docs 2023-09-28 14:08:52 -07:00
alljson.mjs tools: enforce use of trailing commas in tools/ 2022-12-18 16:39:39 +00:00
apilinks.mjs tools: enforce use of trailing commas in tools/ 2022-12-18 16:39:39 +00:00
buildCSSForFlavoredJS.mjs doc: rename possibly confusing variable and CSS class 2023-09-08 17:03:57 +02:00
common.mjs lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
deprecationCodes.mjs tools: enforce use of trailing commas in tools/ 2022-12-18 16:39:39 +00:00
deps.mjs tools: update doc generator dependencies 2021-09-18 16:32:44 +02:00
generate.mjs lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
html.mjs lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
json.mjs lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
LICENSE Mention marked, and add license to doc generator 2012-03-05 10:59:14 -08:00
links-mapper.json doc: clarify module system selection 2022-01-17 11:36:19 +01:00
markdown.mjs lib: prefer logical assignment 2024-10-09 06:42:16 +00:00
package-lock.json tools: update doc to new version 2024-11-17 11:23:48 +00:00
package.json tools: update doc to new version 2024-11-17 11:23:48 +00:00
README.md tools: update doctool dependencies, migrate to ESM 2021-06-14 08:22:00 -07:00
stability.mjs tools: fix stability index generation 2022-11-07 01:25:44 +00:00
type-parser.mjs sqlite: add support for SQLite Session Extension 2024-11-18 00:57:04 +00:00
versions.mjs tools: update main branch name 2022-06-17 08:48:18 +01:00

Here's how the node docs work.

1:1 relationship from lib/<module>.js to doc/api/<module>.md.

Each type of heading has a description block.

# module

<!--introduced_in=v0.10.0-->

> Stability: 2 - Stable

A description and examples.

## module.property
<!-- YAML
added: v0.10.0
-->

* {type}

A description of the property.

## module.someFunction(x, y, [z=100])
<!-- YAML
added: v0.10.0
-->

* `x` {string} The description of the string.
* `y` {boolean} Should I stay or should I go?
* `z` {number} How many zebras to bring. **Default:** `100`.

A description of the function.

## module.someNewFunction(x)
<!-- YAML
added: REPLACEME
-->

* `x` {string} The description of the string.

This feature is not in a release yet.

## Event: 'blerg'
<!-- YAML
added: v0.10.0
-->

* `anArg` {type} A description of the listener argument.

Modules don't usually raise events on themselves. `cluster` is the
only exception.

## Class: SomeClass
<!-- YAML
added: v0.10.0
-->

A description of the class.

### SomeClass.classMethod(anArg)
<!-- YAML
added: v0.10.0
-->

* `anArg` {Object} Just an argument.
  * `field` {string} `anArg` can have this field.
  * `field2` {boolean} Another field. **Default:** `false`.
* Returns: {boolean} `true` if it worked.

A description of the method for humans.

### SomeClass.nextSibling()
<!-- YAML
added: v0.10.0
-->

* Returns: {SomeClass | null} The next `SomeClass` in line.

`SomeClass` must be registered in `tools/doc/type-parser.mjs`
to be properly parsed in `{type}` fields.

### SomeClass.someProperty
<!-- YAML
added: v0.10.0
-->

* {string}

The indication of what `someProperty` is.

### Event: 'grelb'
<!-- YAML
added: v0.10.0
-->

* `isBlerg` {boolean}

This event is emitted on instances of `SomeClass`, not on the module itself.
  • Classes have (description, Properties, Methods, Events).
  • Events have (list of listener arguments, description).
  • Functions have (list of arguments, returned value if defined, description).
  • Methods have (list of arguments, returned value if defined, description).
  • Modules have (description, Properties, Functions, Classes, Examples).
  • Properties have (type, description).