nodejs / node

Node.js JavaScript runtime ✨🐢🚀✨
https://nodejs.org
Other
104.75k stars 28.3k forks source link

Prefer "import attributes" to "import assertions" #52995

Closed worstpractice closed 4 weeks ago

worstpractice commented 1 month ago

Affected URL(s)

https://nodejs.org/docs/latest/api/packages.html#modules-loaders

Description of the problem

The ECMAScript module loader section (bottom) states:

It can load JSON modules, but an import assertion is required.

Here, we should likely:

  1. Prefer "import attributes" to "import assertions" (which are deprecated).
  2. Consider including a relevant link to v8.dev, as either term is otherwise used in the documentation without further explanation, despite their relative obscurity and general confusability (especially to someone googling this newfangled jargon for the first time).
targos commented 1 month ago

https://github.com/nodejs/node/pull/52998