From ee34b20c323da1c7a165cbba5a4105d6e9693212 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Wed, 2 Oct 2024 23:02:31 +0200 Subject: [PATCH] doc: update `require(ESM)` history and stability status PR-URL: https://github.com/nodejs/node/pull/55199 Reviewed-By: Moshe Atlow Reviewed-By: Guy Bedford Reviewed-By: Joyee Cheung --- doc/api/modules.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/api/modules.md b/doc/api/modules.md index 56d435115929d8..ebc17d1c32da5b 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -170,6 +170,13 @@ relative, and based on the real path of the files making the calls to ## Loading ECMAScript modules using `require()` + + +> Stability: 1.1 - Active Development. Enable this API with the +> [`--experimental-require-module`][] CLI flag. + The `.mjs` extension is reserved for [ECMAScript Modules][]. Currently, if the flag `--experimental-require-module` is not used, loading an ECMAScript module using `require()` will throw a [`ERR_REQUIRE_ESM`][] @@ -1183,6 +1190,7 @@ This section was moved to [GLOBAL_FOLDERS]: #loading-from-the-global-folders [`"main"`]: packages.md#main [`"type"`]: packages.md#type +[`--experimental-require-module`]: cli.md#--experimental-require-module [`ERR_REQUIRE_ASYNC_MODULE`]: errors.md#err_require_async_module [`ERR_REQUIRE_ESM`]: errors.md#err_require_esm [`ERR_UNSUPPORTED_DIR_IMPORT`]: errors.md#err_unsupported_dir_import