Skip to content

Commit

Permalink
doc: document support for node:‑prefixed require(…) calls
Browse files Browse the repository at this point in the history
  • Loading branch information
ExE-Boss committed Feb 6, 2021
1 parent 320ef5e commit 3634cd4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
10 changes: 9 additions & 1 deletion doc/api/esm.md
Expand Up @@ -201,6 +201,10 @@ import _ from 'data:application/json,"world!"';
#### `node:` Imports

<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/37246
description: Added `node:` import support to `require(...)`.
added:
- v14.13.1
- v12.20.0
Expand All @@ -210,10 +214,14 @@ added:
modules. This URL scheme allows for builtin modules to be referenced by valid
absolute URL strings.

```js
```js esm
import fs from 'node:fs/promises';
```

```js cjs
const fs = require('node:fs/promises');
```

## Builtin modules

[Core modules][] provide named exports of their public API. A
Expand Down
6 changes: 6 additions & 0 deletions doc/api/modules.md
Expand Up @@ -280,6 +280,12 @@ irrespective of whether or not `./foo` and `./FOO` are the same file.
## Core modules

<!--type=misc-->
<!-- YAML
changes:
- version: REPLACEME
pr-url: https://github.com/nodejs/node/pull/37246
description: Added `node:` import support to `require(...)`.
-->

Node.js has several modules compiled into the binary. These modules are
described in greater detail elsewhere in this documentation.
Expand Down

0 comments on commit 3634cd4

Please sign in to comment.