Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 10 additions & 8 deletions doc/api/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -1177,14 +1177,16 @@ validating the import attributes.

The final value of `format` must be one of the following:

| `format` | Description | Acceptable types for `source` returned by `load` |
| ------------ | ------------------------------ | -------------------------------------------------- |
| `'addon'` | Load a Node.js addon | {null} |
| `'builtin'` | Load a Node.js builtin module | {null} |
| `'commonjs'` | Load a Node.js CommonJS module | {string\|ArrayBuffer\|TypedArray\|null\|undefined} |
| `'json'` | Load a JSON file | {string\|ArrayBuffer\|TypedArray} |
| `'module'` | Load an ES module | {string\|ArrayBuffer\|TypedArray} |
| `'wasm'` | Load a WebAssembly module | {ArrayBuffer\|TypedArray} |
| `format` | Description | Acceptable types for `source` returned by `load` |
| ----------------------- | ----------------------------------------------------- | -------------------------------------------------- |
| `'addon'` | Load a Node.js addon | {null} |
| `'builtin'` | Load a Node.js builtin module | {null} |
| `'commonjs-typescript'` | Load a Node.js CommonJS module with TypeScript syntax | {string\|ArrayBuffer\|TypedArray\|null\|undefined} |
| `'commonjs'` | Load a Node.js CommonJS module | {string\|ArrayBuffer\|TypedArray\|null\|undefined} |
| `'json'` | Load a JSON file | {string\|ArrayBuffer\|TypedArray} |
| `'module-typescript'` | Load an ES module with TypeScript syntax | {string\|ArrayBuffer\|TypedArray} |
| `'module'` | Load an ES module with TypeScript syntax | {string\|ArrayBuffer\|TypedArray} |
| `'wasm'` | Load a WebAssembly module | {ArrayBuffer\|TypedArray} |

The value of `source` is ignored for type `'builtin'` because currently it is
not possible to replace the value of a Node.js builtin (core) module.
Expand Down
Loading