diff --git a/.eslintignore b/.eslintignore index 64f34660d87a8f..f72fbdfd842923 100644 --- a/.eslintignore +++ b/.eslintignore @@ -13,3 +13,5 @@ doc/changelogs/CHANGELOG_v1*.md !doc/changelogs/CHANGELOG_v18.md !doc/api_assets/*.js !.eslintrc.js +test/es-module/test-require-module-entry-point.js +test/es-module/test-require-module-entry-point-aou.js diff --git a/doc/api/cli.md b/doc/api/cli.md index bdae4a7e771391..bbfb111e051d4d 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -871,6 +871,22 @@ added: v11.8.0 Use the specified file as a security policy. +### `--experimental-require-module` + + + +> Stability: 1.1 - Active Developement + +Supports loading a synchronous ES module graph in `require()`. If the module +graph is not synchronous (contains top-level await), it throws an error. + +By default, a `.js` file will be parsed as a CommonJS module first. If it +contains ES module syntax, Node.js will try to parse and evaluate the module +again as an ES module. If it turns out to be synchronous and can be evaluated +successfully, the module namespace object will be returned by `require()`. + ### `--experimental-sea-config`