Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Update doc/api/esm.md
Co-authored-by: Derek Lewis <DerekNonGeneric@inf.is>
  • Loading branch information
bmeck and Derek Lewis authored May 19, 2020
commit 525554d4e3e0ee33878bfd32c0254fbb484b9bb7
14 changes: 9 additions & 5 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -1205,15 +1205,19 @@ of the following:
| `'builtin'` | Load a Node.js builtin module | Not applicable |
| `'commonjs'` | Load a Node.js CommonJS module | Not applicable |
| `'dynamic'` | Use a [dynamic instantiate hook][] | Not applicable |
| `'json'` | Load a JSON file | array buffer, string, or typed array |
| `'module'` | Load a standard JavaScript module (ES module) | array buffer, string, or typed array |
| `'wasm'` | Load a WebAssembly module | array buffer, or typed array |
| `'json'` | Load a JSON file | { [ArrayBuffer][], [string][], [TypedArray][] } |
| `'module'` | Load an ES module | { [ArrayBuffer][], [string][], [TypedArray][] } |
| `'wasm'` | Load a WebAssembly module | { [ArrayBuffer][], [string][], [TypedArray][] } |

Note: These types all correspond to classes defined in ECMAScript.

* The specific [ArrayBuffer][] object is a [SharedArrayBuffer][].
* The specific [string][] object is not the class constructor, but an instance.
* The specific [TypedArray][] object is a [Uint8Array][].

Note: If the source value of a text-based format (i.e., `'json'`, `'module'`) is
not a string, it will be converted to a string using [`util.TextDecoder`][].

Note: `Buffer` is a form of typed array.

```js
/**
* @param {string} url
Expand Down