Skip to content

🚀 Example: Native require(ESM) #106

Open
@JoshuaKGoldberg

Description

@JoshuaKGoldberg

Example Request Checklist

Overview

Now that Node.js natively supports CommonJS files loading ESM ones in 22.12.01 and 23.0.02, there's no more need to use transpilers/etc. to require ESM modules in CommonJS code! 🎉

Suggested Solution

I'll add a straightforward example showing this.

Additional Info

Footnotes

  1. https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V22.md#requireesm-is-now-enabled-by-default

  2. https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V23.md#2024-10-16-version-2300-current-rafaelgss

Metadata

Metadata

Labels

status: accepting prsPlease, send a pull request to resolve this! 🙏type: featureNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions