Skip to content

Commit 63ad821

Browse files
committed
doc: add missing llm_description
1 parent 53bcd11 commit 63ad821

6 files changed

Lines changed: 60 additions & 49 deletions

File tree

doc/api/async_context.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
77
<!-- source_link=lib/async_hooks.js -->
88

9+
<!-- llm_description=Tracks asynchronous execution context. Enables storing and propagating state across async operations like callbacks and promises. Useful for request tracking, logging, or context management. Provides AsyncLocalStorage for scoped storage and AsyncResource for custom async context binding. -->
10+
911
## Introduction
1012

1113
These classes are used to associate state and propagate it throughout

doc/api/esm.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<!--introduced_in=v8.5.0-->
44

5+
<!-- llm_description=Provides support for ECMAScript modules in Node.js, enabling standards-based module syntax (import/export) and interoperability with CommonJS. -->
6+
57
<!-- type=misc -->
68

79
<!-- YAML

doc/api/module.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<!--introduced_in=v12.20.0-->
44

5+
<!-- llm_description=Provides utilities for interacting with Node.js modules, including support for module creation, resolution, customization hooks, and compile caching. Enables advanced module loading behavior. -->
6+
57
<!-- YAML
68
added: v0.3.7
79
-->

doc/api/packages.md

Lines changed: 51 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
<!-- type=misc -->
66

7+
<!-- llm_description=Defines how Node.js resolves and loads modules via fields like type, exports, and imports. Controls module format, entry points, and package encapsulation. -->
8+
79
<!-- YAML
810
changes:
911
- version:
@@ -61,15 +63,15 @@ Node.js will treat the following as [ES modules][] when passed to `node` as the
6163
initial input, or when referenced by `import` statements or `import()`
6264
expressions:
6365

64-
* Files with an `.mjs` extension.
66+
- Files with an `.mjs` extension.
6567

66-
* Files with a `.js` extension when the nearest parent `package.json` file
68+
- Files with a `.js` extension when the nearest parent `package.json` file
6769
contains a top-level [`"type"`][] field with a value of `"module"`.
6870

69-
* Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`,
71+
- Strings passed in as an argument to `--eval`, or piped to `node` via `STDIN`,
7072
with the flag `--input-type=module`.
7173

72-
* Code containing syntax only successfully parsed as [ES modules][], such as
74+
- Code containing syntax only successfully parsed as [ES modules][], such as
7375
`import` or `export` statements or `import.meta`, with no explicit marker of
7476
how it should be interpreted. Explicit markers are `.mjs` or `.cjs`
7577
extensions, `package.json` `"type"` fields with either `"module"` or
@@ -81,15 +83,15 @@ Node.js will treat the following as [CommonJS][] when passed to `node` as the
8183
initial input, or when referenced by `import` statements or `import()`
8284
expressions:
8385

84-
* Files with a `.cjs` extension.
86+
- Files with a `.cjs` extension.
8587

86-
* Files with a `.js` extension when the nearest parent `package.json` file
88+
- Files with a `.js` extension when the nearest parent `package.json` file
8789
contains a top-level field [`"type"`][] with a value of `"commonjs"`.
8890

89-
* Strings passed in as an argument to `--eval` or `--print`, or piped to `node`
91+
- Strings passed in as an argument to `--eval` or `--print`, or piped to `node`
9092
via `STDIN`, with the flag `--input-type=commonjs`.
9193

92-
* Files with a `.js` extension with no parent `package.json` file or where the
94+
- Files with a `.js` extension with no parent `package.json` file or where the
9395
nearest parent `package.json` file lacks a `type` field, and where the code
9496
can evaluate successfully as CommonJS. In other words, Node.js tries to run
9597
such "ambiguous" files as CommonJS first, and will retry evaluating them as ES
@@ -127,19 +129,19 @@ as an ES module.
127129

128130
Ambiguous input is defined as:
129131

130-
* Files with a `.js` extension or no extension; and either no controlling
132+
- Files with a `.js` extension or no extension; and either no controlling
131133
`package.json` file or one that lacks a `type` field.
132-
* String input (`--eval` or `STDIN`) when `--input-type`is not specified.
134+
- String input (`--eval` or `STDIN`) when `--input-type`is not specified.
133135

134136
ES module syntax is defined as syntax that would throw when evaluated as
135137
CommonJS. This includes the following:
136138

137-
* `import` statements (but _not_ `import()` expressions, which are valid in
139+
- `import` statements (but _not_ `import()` expressions, which are valid in
138140
CommonJS).
139-
* `export` statements.
140-
* `import.meta` references.
141-
* `await` at the top level of a module.
142-
* Lexical redeclarations of the CommonJS wrapper variables (`require`, `module`,
141+
- `export` statements.
142+
- `import.meta` references.
143+
- `await` at the top level of a module.
144+
- Lexical redeclarations of the CommonJS wrapper variables (`require`, `module`,
143145
`exports`, `__dirname`, `__filename`).
144146

145147
### Module resolution and loading
@@ -239,12 +241,12 @@ import 'commonjs-package/src/index.mjs';
239241
The `.mjs` and `.cjs` extensions can be used to mix types within the same
240242
package:
241243

242-
* Within a `"type": "module"` package, Node.js can be instructed to
244+
- Within a `"type": "module"` package, Node.js can be instructed to
243245
interpret a particular file as [CommonJS][] by naming it with a `.cjs`
244246
extension (since both `.js` and `.mjs` files are treated as ES modules within
245247
a `"module"` package).
246248

247-
* Within a `"type": "commonjs"` package, Node.js can be instructed to
249+
- Within a `"type": "commonjs"` package, Node.js can be instructed to
248250
interpret a particular file as an [ES module][] by naming it with an `.mjs`
249251
extension (since both `.js` and `.cjs` files are treated as CommonJS within a
250252
`"commonjs"` package).
@@ -459,8 +461,8 @@ keys) must be relative URL strings starting with `./`.
459461
{
460462
"name": "my-package",
461463
"exports": {
462-
".": "./dist/main.js", // Correct
463-
"./feature": "./lib/feature.js", // Correct
464+
".": "./dist/main.js", // Correct
465+
"./feature": "./lib/feature.js" // Correct
464466
// "./origin-relative": "/dist/main.js", // Incorrect: Must start with ./
465467
// "./absolute": "file:///dev/null", // Incorrect: Must start with ./
466468
// "./outside": "../common/util.js" // Incorrect: Must start with ./
@@ -470,9 +472,9 @@ keys) must be relative URL strings starting with `./`.
470472

471473
Reasons for this behavior include:
472474

473-
* **Security:** Prevents exporting arbitrary files from outside the
475+
- **Security:** Prevents exporting arbitrary files from outside the
474476
package's own directory.
475-
* **Encapsulation:** Ensures all exported paths are resolved relative to
477+
- **Encapsulation:** Ensures all exported paths are resolved relative to
476478
the package root, making the package self-contained.
477479

478480
##### No path traversal or invalid segments
@@ -689,28 +691,28 @@ For example, a package that wants to provide different ES module exports for
689691
Node.js implements the following conditions, listed in order from most
690692
specific to least specific as conditions should be defined:
691693

692-
* `"node-addons"` - similar to `"node"` and matches for any Node.js environment.
694+
- `"node-addons"` - similar to `"node"` and matches for any Node.js environment.
693695
This condition can be used to provide an entry point which uses native C++
694696
addons as opposed to an entry point which is more universal and doesn't rely
695697
on native addons. This condition can be disabled via the
696698
[`--no-addons` flag][].
697-
* `"node"` - matches for any Node.js environment. Can be a CommonJS or ES
699+
- `"node"` - matches for any Node.js environment. Can be a CommonJS or ES
698700
module file. _In most cases explicitly calling out the Node.js platform is
699701
not necessary._
700-
* `"import"` - matches when the package is loaded via `import` or
702+
- `"import"` - matches when the package is loaded via `import` or
701703
`import()`, or via any top-level import or resolve operation by the
702704
ECMAScript module loader. Applies regardless of the module format of the
703705
target file. _Always mutually exclusive with `"require"`._
704-
* `"require"` - matches when the package is loaded via `require()`. The
706+
- `"require"` - matches when the package is loaded via `require()`. The
705707
referenced file should be loadable with `require()` although the condition
706708
matches regardless of the module format of the target file. Expected
707709
formats include CommonJS, JSON, native addons, and ES modules. _Always mutually
708710
exclusive with `"import"`._
709-
* `"module-sync"` - matches no matter the package is loaded via `import`,
711+
- `"module-sync"` - matches no matter the package is loaded via `import`,
710712
`import()` or `require()`. The format is expected to be ES modules that does
711713
not contain top-level await in its module graph - if it does,
712714
`ERR_REQUIRE_ASYNC_MODULE` will be thrown when the module is `require()`-ed.
713-
* `"default"` - the generic fallback that always matches. Can be a CommonJS
715+
- `"default"` - the generic fallback that always matches. Can be a CommonJS
714716
or ES module file. _This condition should always come last._
715717

716718
Within the [`"exports"`][] object, key order is significant. During condition
@@ -825,14 +827,14 @@ Since custom package conditions require clear definitions to ensure correct
825827
usage, a list of common known package conditions and their strict definitions
826828
is provided below to assist with ecosystem coordination.
827829

828-
* `"types"` - can be used by typing systems to resolve the typing file for
830+
- `"types"` - can be used by typing systems to resolve the typing file for
829831
the given export. _This condition should always be included first._
830-
* `"browser"` - any web browser environment.
831-
* `"development"` - can be used to define a development-only environment
832+
- `"browser"` - any web browser environment.
833+
- `"development"` - can be used to define a development-only environment
832834
entry point, for example to provide additional debugging context such as
833835
better error messages when running in a development mode. _Must always be
834836
mutually exclusive with `"production"`._
835-
* `"production"` - can be used to define a production environment entry
837+
- `"production"` - can be used to define a production environment entry
836838
point. _Must always be mutually exclusive with `"development"`._
837839

838840
For other runtimes, platform-specific condition key definitions are maintained
@@ -842,16 +844,16 @@ New conditions definitions may be added to this list by creating a pull request
842844
to the [Node.js documentation for this section][]. The requirements for listing
843845
a new condition definition here are that:
844846

845-
* The definition should be clear and unambiguous for all implementers.
846-
* The use case for why the condition is needed should be clearly justified.
847-
* There should exist sufficient existing implementation usage.
848-
* The condition name should not conflict with another condition definition or
847+
- The definition should be clear and unambiguous for all implementers.
848+
- The use case for why the condition is needed should be clearly justified.
849+
- There should exist sufficient existing implementation usage.
850+
- The condition name should not conflict with another condition definition or
849851
condition in wide usage.
850-
* The listing of the condition definition should provide a coordination
852+
- The listing of the condition definition should provide a coordination
851853
benefit to the ecosystem that wouldn't otherwise be possible. For example,
852854
this would not necessarily be the case for company-specific or
853855
application-specific conditions.
854-
* The condition should be such that a Node.js user would expect it to be in
856+
- The condition should be such that a Node.js user would expect it to be in
855857
Node.js core documentation. The `"types"` condition is a good example: It
856858
doesn't really belong in the [Runtime Keys][] proposal but is a good fit
857859
here in the Node.js docs.
@@ -955,15 +957,15 @@ additional fields which are ignored by Node.js and not documented here.
955957

956958
The following fields in `package.json` files are used in Node.js:
957959

958-
* [`"name"`][] - Relevant when using named imports within a package. Also used
960+
- [`"name"`][] - Relevant when using named imports within a package. Also used
959961
by package managers as the name of the package.
960-
* [`"main"`][] - The default module when loading the package, if exports is not
962+
- [`"main"`][] - The default module when loading the package, if exports is not
961963
specified, and in versions of Node.js prior to the introduction of exports.
962-
* [`"type"`][] - The package type determining whether to load `.js` files as
964+
- [`"type"`][] - The package type determining whether to load `.js` files as
963965
CommonJS or ES modules.
964-
* [`"exports"`][] - Package exports and conditional exports. When present,
966+
- [`"exports"`][] - Package exports and conditional exports. When present,
965967
limits which submodules can be loaded from within the package.
966-
* [`"imports"`][] - Package imports, for use by modules within the package
968+
- [`"imports"`][] - Package imports, for use by modules within the package
967969
itself.
968970

969971
### `"name"`
@@ -980,7 +982,7 @@ changes:
980982
description: Remove the `--experimental-resolve-self` option.
981983
-->
982984

983-
* Type: {string}
985+
- Type: {string}
984986

985987
```json
986988
{
@@ -1001,7 +1003,7 @@ The `"name"` field can be used in addition to the [`"exports"`][] field to
10011003
added: v0.4.0
10021004
-->
10031005

1004-
* Type: {string}
1006+
- Type: {string}
10051007

10061008
```json
10071009
{
@@ -1010,7 +1012,7 @@ added: v0.4.0
10101012
```
10111013

10121014
The `"main"` field defines the entry point of a package when imported by name
1013-
via a `node_modules` lookup. Its value is a path.
1015+
via a `node_modules` lookup. Its value is a path.
10141016

10151017
The [`"exports"`][] field, if it exists, takes precedence over the
10161018
`"main"` field when importing the package by name.
@@ -1035,7 +1037,7 @@ changes:
10351037
description: Unflag `--experimental-modules`.
10361038
-->
10371039

1038-
* Type: {string}
1040+
- Type: {string}
10391041

10401042
The `"type"` field defines the module format that Node.js uses for all
10411043
`.js` files that have that `package.json` file as their nearest parent.
@@ -1046,7 +1048,7 @@ Files ending with `.js` are loaded as ES modules when the nearest parent
10461048

10471049
The nearest parent `package.json` is defined as the first `package.json` found
10481050
when searching in the current folder, that folder's parent, and so on up
1049-
until a node\_modules folder or the volume root is reached.
1051+
until a node_modules folder or the volume root is reached.
10501052

10511053
```json
10521054
// package.json
@@ -1108,7 +1110,7 @@ changes:
11081110
description: Implement conditional exports.
11091111
-->
11101112

1111-
* Type: {Object|string|string\[]}
1113+
- Type: {Object|string|string\[]}
11121114

11131115
```json
11141116
{
@@ -1137,7 +1139,7 @@ added:
11371139
- v12.19.0
11381140
-->
11391141

1140-
* Type: {Object}
1142+
- Type: {Object}
11411143

11421144
```json
11431145
// package.json

doc/api/synopsis.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Usage and example
22

3+
<!-- llm_description=Overview of basic Node.js usage via CLI. Illustrates how to run scripts and provides a simple web server example. -->
4+
35
<!--introduced_in=v0.10.0-->
46

57
<!--type=misc-->

doc/api/typescript.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ changes:
2828
<!--introduced_in=v22.6.0-->
2929

3030
> Stability: 2 - Stable
31+
<!-- llm_description=Provides lightweight TypeScript support in Node.js via type stripping. Enables execution of .ts files without type checking or full compiler features. -->
3132
3233
## Enabling
3334

0 commit comments

Comments
 (0)