diff --git a/doc/api/modules.md b/doc/api/modules.md index 1f833640b192e2..5005bbb85eec2d 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -250,6 +250,9 @@ If `--experimental-print-required-tla` is enabled, instead of throwing module, try to locate the top-level awaits, and print their location to help users fix them. +This feature can be detected by checking if +[`process.features.require_module`][] is `true`. + ## All together @@ -1214,6 +1217,7 @@ This section was moved to [`node:test`]: test.md [`package.json`]: packages.md#nodejs-packagejson-field-definitions [`path.dirname()`]: path.md#pathdirnamepath +[`process.features.require_module`]: process.md#processfeaturesrequire_module [`require.main`]: #requiremain [exports shortcut]: #exports-shortcut [module resolution]: #all-together diff --git a/doc/api/process.md b/doc/api/process.md index 070016a842d565..385ee2f0a751d0 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1928,6 +1928,17 @@ added: v0.5.3 A boolean value that is `true` if the current Node.js build includes support for IPv6. +## `process.features.require_module` + + + +* {boolean} + +A boolean value that is `true` if the current Node.js build supports +[loading ECMAScript modules using `require()`][]. + ## `process.features.tls`