Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 42c0dfc

Browse filesBrowse files
bmeckMylesBorins
authored andcommitted
doc: importable node protocol URLs
PR-URL: #35434 Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jan Krems <jan.krems@gmail.com>
1 parent c192af6 commit 42c0dfc
Copy full SHA for 42c0dfc

File tree

Expand file treeCollapse file tree

1 file changed

+15
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+15
-1
lines changed
Open diff view settings
Collapse file

‎doc/api/esm.md‎

Copy file name to clipboardExpand all lines: doc/api/esm.md
+15-1Lines changed: 15 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,27 @@ There are four types of specifiers:
125125
Bare specifiers, and the bare specifier portion of deep import specifiers, are
126126
strings; but everything else in a specifier is a URL.
127127

128-
Only `file:` and `data:` URLs are supported. A specifier like
128+
`file:`, `node:`, and `data:` URLs are supported. A specifier like
129129
`'https://example.com/app.js'` may be supported by browsers but it is not
130130
supported in Node.js.
131131

132132
Specifiers may not begin with `/` or `//`. These are reserved for potential
133133
future use. The root of the current volume may be referenced via `file:///`.
134134

135+
#### `node:` Imports
136+
137+
<!-- YAML
138+
added: REPLACEME
139+
-->
140+
141+
`node:` URLs are supported as a means to load Node.js builtin modules. This
142+
URL scheme allows for builtin modules to be referenced by valid absolute URL
143+
strings.
144+
145+
```js
146+
import fs from 'node:fs/promises';
147+
```
148+
135149
#### `data:` Imports
136150

137151
<!-- YAML

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.