• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1Here's how the node docs work.
2
31:1 relationship from `lib/<module>.js` to `doc/api/<module>.md`.
4
5Each type of heading has a description block.
6
7```markdown
8# module
9
10<!--introduced_in=v0.10.0-->
11
12> Stability: 2 - Stable
13
14A description and examples.
15
16## module.property
17<!-- YAML
18added: v0.10.0
19-->
20
21* {type}
22
23A description of the property.
24
25## module.someFunction(x, y, [z=100])
26<!-- YAML
27added: v0.10.0
28-->
29
30* `x` {string} The description of the string.
31* `y` {boolean} Should I stay or should I go?
32* `z` {number} How many zebras to bring. **Default:** `100`.
33
34A description of the function.
35
36## module.someNewFunction(x)
37<!-- YAML
38added: REPLACEME
39-->
40
41* `x` {string} The description of the string.
42
43This feature is not in a release yet.
44
45## Event: 'blerg'
46<!-- YAML
47added: v0.10.0
48-->
49
50* `anArg` {type} A description of the listener argument.
51
52Modules don't usually raise events on themselves. `cluster` is the
53only exception.
54
55## Class: SomeClass
56<!-- YAML
57added: v0.10.0
58-->
59
60A description of the class.
61
62### SomeClass.classMethod(anArg)
63<!-- YAML
64added: v0.10.0
65-->
66
67* `anArg` {Object} Just an argument.
68  * `field` {string} `anArg` can have this field.
69  * `field2` {boolean} Another field. **Default:** `false`.
70* Returns: {boolean} `true` if it worked.
71
72A description of the method for humans.
73
74### SomeClass.nextSibling()
75<!-- YAML
76added: v0.10.0
77-->
78
79* Returns: {SomeClass | null} The next `SomeClass` in line.
80
81`SomeClass` must be registered in `tools/doc/type-parser.mjs`
82to be properly parsed in `{type}` fields.
83
84### SomeClass.someProperty
85<!-- YAML
86added: v0.10.0
87-->
88
89* {string}
90
91The indication of what `someProperty` is.
92
93### Event: 'grelb'
94<!-- YAML
95added: v0.10.0
96-->
97
98* `isBlerg` {boolean}
99
100This event is emitted on instances of `SomeClass`, not on the module itself.
101```
102
103* Classes have (description, Properties, Methods, Events).
104* Events have (list of listener arguments, description).
105* Functions have (list of arguments, returned value if defined, description).
106* Methods have (list of arguments, returned value if defined, description).
107* Modules have (description, Properties, Functions, Classes, Examples).
108* Properties have (type, description).
109