9a1df15ee7
Notable changes: benchmark: * add AbortSignal.abort benchmarks (Raz Luvaton) https://github.com/nodejs/node/pull/52408 buffer: * improve `base64` and `base64url` performance (Yagiz Nizipli) https://github.com/nodejs/node/pull/52428 crypto: * deprecate implicitly shortened GCM tags (Tobias Nießen) https://github.com/nodejs/node/pull/52345 deps: * (SEMVER-MINOR) update simdutf to 5.0.0 (Daniel Lemire) https://github.com/nodejs/node/pull/52138 * (SEMVER-MINOR) update undici to 6.3.0 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51462 * (SEMVER-MINOR) update undici to 6.2.1 (Node.js GitHub Bot) https://github.com/nodejs/node/pull/51278 dns: * (SEMVER-MINOR) add order option and support ipv6first (Paolo Insogna) https://github.com/nodejs/node/pull/52492 doc: * update release gpg keyserver (marco-ippolito) https://github.com/nodejs/node/pull/52257 * add release key for marco-ippolito (marco-ippolito) https://github.com/nodejs/node/pull/52257 * add UlisesGascon as a collaborator (Ulises Gascón) https://github.com/nodejs/node/pull/51991 * (SEMVER-MINOR) deprecate fs.Stats public constructor (Marco Ippolito) https://github.com/nodejs/node/pull/51879 events,doc: * mark CustomEvent as stable (Daeyeon Jeong) https://github.com/nodejs/node/pull/52618 fs: * add stacktrace to fs/promises (翠 / green) https://github.com/nodejs/node/pull/49849 lib, url: * (SEMVER-MINOR) add a `windows` option to path parsing (Aviv Keller) https://github.com/nodejs/node/pull/52509 net: * (SEMVER-MINOR) add CLI option for autoSelectFamilyAttemptTimeout (Paolo Insogna) https://github.com/nodejs/node/pull/52474 report: * (SEMVER-MINOR) add `--report-exclude-network` option (Ethan Arrowood) https://github.com/nodejs/node/pull/51645 src: * (SEMVER-MINOR) add `string_view` overload to snapshot FromBlob (Anna Henningsen) https://github.com/nodejs/node/pull/52595 * (SEMVER-MINOR) add C++ ProcessEmitWarningSync() (Joyee Cheung) https://github.com/nodejs/node/pull/51977 * (SEMVER-MINOR) add uv_get_available_memory to report and process (theanarkh) https://github.com/nodejs/node/pull/52023 * (SEMVER-MINOR) preload function for Environment (Cheng Zhao) https://github.com/nodejs/node/pull/51539 stream: * (SEMVER-MINOR) support typed arrays (IlyasShabi) https://github.com/nodejs/node/pull/51866 test_runner: * (SEMVER-MINOR) add suite() (Colin Ihrig) https://github.com/nodejs/node/pull/52127 * (SEMVER-MINOR) add `test:complete` event to reflect execution order (Moshe Atlow) https://github.com/nodejs/node/pull/51909 util: * (SEMVER-MINOR) support array of formats in util.styleText (Marco Ippolito) https://github.com/nodejs/node/pull/52040 v8: * (SEMVER-MINOR) implement v8.queryObjects() for memory leak regression testing (Joyee Cheung) https://github.com/nodejs/node/pull/51927 watch: * mark as stable (Moshe Atlow) https://github.com/nodejs/node/pull/52074 PR-URL: https://github.com/nodejs/node/pull/52793 |
||
---|---|---|
.. | ||
api | ||
api_assets | ||
changelogs | ||
contributing | ||
.eslintrc.yaml | ||
abi_version_registry.json | ||
first_timer_badge.png | ||
full-white-stripe.jpg | ||
node.1 | ||
osx_installer_logo.png | ||
README.md | ||
template.html | ||
thin-white-stripe.jpg |
Documentation style guide
This style guide helps us create organized and easy-to-read documentation. It provides guidelines for organization, spelling, formatting, and more.
These are guidelines rather than strict rules. Content is more important than formatting. You do not need to learn the entire style guide before contributing to documentation. Someone can always edit your material later to conform with this guide.
- Documentation is in markdown files with names formatted as
lowercase-with-dashes.md
.- Use an underscore in the filename only if the underscore is part of the
topic name (e.g.,
child_process
). - Some files, such as top-level markdown files, are exceptions.
- Use an underscore in the filename only if the underscore is part of the
topic name (e.g.,
- Documents should be word-wrapped at 80 characters.
.editorconfig
describes the preferred formatting.- A plugin is available for some editors to apply these rules.
- Check changes to documentation with
make test-doc -j
orvcbuild test-doc
. - Use US spelling.
- Use serial commas.
- Avoid first-person pronouns (I, we).
- Exception: we recommend foo is preferable to foo is recommended.
- Use gender-neutral pronouns and gender-neutral plural nouns.
- OK: they, their, them, folks, people, developers
- NOT OK: his, hers, him, her, guys, dudes
- When combining wrapping elements (parentheses and quotes), place terminal
punctuation:
- Inside the wrapping element if the wrapping element contains a complete clause.
- Outside of the wrapping element if the wrapping element contains only a fragment of a clause.
- Documents must start with a level-one heading.
- Prefer affixing links (
[a link][]
) to inlining links ([a link](http://example.com)
). - When documenting APIs, update the YAML comment associated with the API as appropriate. This is especially true when introducing or deprecating an API.
- When documenting APIs, every function should have a usage example or link to an example that uses the function.
- For code blocks:
-
Use language-aware fences. (
```js
) -
For the info string, use one of the following.
Meaning Info string Bash bash
C c
C++ cpp
CoffeeScript coffee
Diff diff
HTTP http
JavaScript js
JSON json
Markdown markdown
Plaintext text
Powershell powershell
R r
Shell Session console
If one of your language-aware fences needs an info string that is not already on this list, you may use
text
until the grammar gets added toremark-preset-lint-node
. -
Code need not be complete. Treat code blocks as an illustration or aid to your point, not as complete running programs. If a complete running program is necessary, include it as an asset in
assets/code-examples
and link to it.
-
- When using underscores, asterisks, and backticks, please use
backslash-escaping:
\_
,\*
, and\`
. - Constructors should use PascalCase.
- Instances should use camelCase.
- Denote methods with parentheses:
socket.end()
instead ofsocket.end
. - Function arguments or object properties should use the following format:
* `name` {type|type2} Optional description. **Default:** `value`.
- For example:
*
byteOffset
{integer} Index of first byte to expose. Default:0
.
- The
type
should refer to a Node.js type or a JavaScript type.
- Function returns should use the following format:
* Returns: {type|type2} Optional description.
- E.g.
* Returns: {AsyncHook} A reference to
asyncHook
.
- Use official styling for capitalization in products and projects.
- OK: JavaScript, Google's V8
- NOT OK: Javascript, Google's v8
- Use Node.js and not Node, NodeJS, or similar variants.
- When referring to the executable,
node
is acceptable.
- When referring to the executable,
- Be direct.
- When referring to a version of Node.js in prose, use Node.js and the version
number. Do not prefix the version number with v in prose. This is to avoid
confusion about whether v8 refers to Node.js 8.x or the V8 JavaScript
engine.
- OK: Node.js 14.x, Node.js 14.3.1
- NOT OK: Node.js v14
- Use sentence-style capitalization for headings.
See also API documentation structure overview in doctools README.
For topics not covered here, refer to the Microsoft Writing Style Guide.