You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/api/async_context.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,8 @@
6
6
7
7
<!-- source_link=lib/async_hooks.js -->
8
8
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
+
9
11
## Introduction
10
12
11
13
These classes are used to associate state and propagate it throughout
Copy file name to clipboardExpand all lines: doc/api/esm.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
<!--introduced_in=v8.5.0-->
4
4
5
+
<!-- llm_description=Provides support for ECMAScript modules in Node.js, enabling standards-based module syntax (import/export) and interoperability with CommonJS. -->
Copy file name to clipboardExpand all lines: doc/api/module.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@
2
2
3
3
<!--introduced_in=v12.20.0-->
4
4
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. -->
Copy file name to clipboardExpand all lines: doc/api/packages.md
+51-49Lines changed: 51 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
<!-- type=misc -->
6
6
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
+
7
9
<!-- YAML
8
10
changes:
9
11
- version:
@@ -61,15 +63,15 @@ Node.js will treat the following as [ES modules][] when passed to `node` as the
61
63
initial input, or when referenced by `import` statements or `import()`
62
64
expressions:
63
65
64
-
* Files with an `.mjs` extension.
66
+
- Files with an `.mjs` extension.
65
67
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
67
69
contains a top-level [`"type"`][] field with a value of `"module"`.
68
70
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`,
70
72
with the flag `--input-type=module`.
71
73
72
-
* Code containing syntax only successfully parsed as [ES modules][], such as
74
+
- Code containing syntax only successfully parsed as [ES modules][], such as
73
75
`import` or `export` statements or `import.meta`, with no explicit marker of
74
76
how it should be interpreted. Explicit markers are `.mjs` or `.cjs`
75
77
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
81
83
initial input, or when referenced by `import` statements or `import()`
82
84
expressions:
83
85
84
-
* Files with a `.cjs` extension.
86
+
- Files with a `.cjs` extension.
85
87
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
87
89
contains a top-level field [`"type"`][] with a value of `"commonjs"`.
88
90
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`
90
92
via `STDIN`, with the flag `--input-type=commonjs`.
91
93
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
93
95
nearest parent `package.json` file lacks a `type` field, and where the code
94
96
can evaluate successfully as CommonJS. In other words, Node.js tries to run
95
97
such "ambiguous" files as CommonJS first, and will retry evaluating them as ES
@@ -127,19 +129,19 @@ as an ES module.
127
129
128
130
Ambiguous input is defined as:
129
131
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
131
133
`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.
133
135
134
136
ES module syntax is defined as syntax that would throw when evaluated as
135
137
CommonJS. This includes the following:
136
138
137
-
*`import` statements (but _not_`import()` expressions, which are valid in
139
+
-`import` statements (but _not_`import()` expressions, which are valid in
138
140
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`,
Copy file name to clipboardExpand all lines: doc/api/typescript.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ changes:
28
28
<!--introduced_in=v22.6.0-->
29
29
30
30
> 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. -->
0 commit comments