Skip to content

Commit 3634cd4

Browse files
committed
doc: document support for node:‑prefixed require(…) calls
1 parent 320ef5e commit 3634cd4

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

doc/api/esm.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ import _ from 'data:application/json,"world!"';
201201
#### `node:` Imports
202202

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

213-
```js
217+
```js esm
214218
import fs from 'node:fs/promises';
215219
```
216220

221+
```js cjs
222+
const fs = require('node:fs/promises');
223+
```
224+
217225
## Builtin modules
218226

219227
[Core modules][] provide named exports of their public API. A

doc/api/modules.md

+6
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,12 @@ irrespective of whether or not `./foo` and `./FOO` are the same file.
280280
## Core modules
281281

282282
<!--type=misc-->
283+
<!-- YAML
284+
changes:
285+
- version: REPLACEME
286+
pr-url: https://github.com/nodejs/node/pull/37246
287+
description: Added `node:` import support to `require(...)`.
288+
-->
283289

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

0 commit comments

Comments
 (0)