@@ -262,13 +262,9 @@ changes:
262
262
description: Switch from Import Assertions to Import Attributes.
263
263
-->
264
264
265
- > Stability: 1.1 - Active development
266
-
267
- > This feature was previously named "Import assertions", and using the ` assert `
268
- > keyword instead of ` with ` . Any uses in code of the prior ` assert ` keyword
269
- > should be updated to use ` with ` instead.
265
+ > Stability: 2 - Stable
270
266
271
- The [ Import Attributes proposal ] [ ] adds an inline syntax for module import
267
+ [ Import attributes ] [ Import Attributes MDN ] are an inline syntax for module import
272
268
statements to pass on more information alongside the module specifier.
273
269
274
270
``` js
@@ -278,13 +274,14 @@ const { default: barData } =
278
274
await import (' ./bar.json' , { with: { type: ' json' } });
279
275
```
280
276
281
- Node.js supports the following ` type ` values, for which the attribute is
282
- mandatory:
277
+ Node.js only supports the ` type ` attribute, for which it supports the following values:
283
278
284
279
| Attribute ` type ` | Needed for |
285
280
| ---------------- | ---------------- |
286
281
| ` 'json' ` | [ JSON modules] [ ] |
287
282
283
+ The ` type: 'json' ` attribute is mandatory when importing JSON modules.
284
+
288
285
## Built-in modules
289
286
290
287
[ Built-in modules] [ ] provide named exports of their public API. A
@@ -591,7 +588,7 @@ separate cache.
591
588
592
589
## JSON modules
593
590
594
- > Stability: 1 - Experimental
591
+ > Stability: 2 - Stable
595
592
596
593
JSON files can be referenced by ` import` :
597
594
@@ -1129,7 +1126,7 @@ resolution for ESM specifiers is [commonjs-extension-resolution-loader][].
1129
1126
[Dynamic ` import()` ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import
1130
1127
[ES Module Integration Proposal for WebAssembly]: https://github.com/webassembly/esm-integration
1131
1128
[Import Attributes]: #import-attributes
1132
- [Import Attributes proposal ]: https://github.com/tc39/proposal- import-attributes
1129
+ [Import Attributes MDN ]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/ import/with
1133
1130
[JSON modules]: #json-modules
1134
1131
[Loading ECMAScript modules using ` require()` ]: modules.md#loading-ecmascript-modules-using-require
1135
1132
[Module customization hooks]: module.md#customization-hooks
0 commit comments