@@ -134,6 +134,27 @@ added: v6.0.0
134134Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with
135135` ./configure --openssl-fips ` .)
136136
137+ ### ` --es-module-specifier-resolution=mode `
138+ <!-- YAML
139+ added: REPLACEME
140+ -->
141+
142+ To be used in conjunction with ` --experimental modules ` . Sets the resolution
143+ algorithm for resolving specifiers. Valid options are ` explicit ` and ` node ` .
144+
145+ The default is ` explicit ` , which requires you to provide the full path to a
146+ module. The ` node ` mode will enable support for optional file extensions and
147+ the ability to import a directory that has an index file.
148+
149+ Please see [ customizing esm specifier resolution] [ ] for example usage.
150+
151+ ### ` --experimental-json-modules `
152+ <!-- YAML
153+ added: REPLACEME
154+ -->
155+
156+ Enable experimental JSON support for the ES Module loader.
157+
137158### ` --experimental-modules `
138159<!-- YAML
139160added: v8.5.0
@@ -513,13 +534,13 @@ Track heap object allocations for heap snapshots.
513534
514535### ` -m ` , ` --type=type `
515536
516- When using ` --experimental-modules ` , this informs the module resolution type
517- to interpret the top-level entry into Node.js .
537+ Used with ` --experimental-modules ` , this configures Node.js to interpret the
538+ initial entry point as CommonJS or as an ES module .
518539
519- Works with stdin, ` --eval ` , ` --print ` as well as standard execution.
540+ Valid values are ` "commonjs" ` and ` "module" ` . The default is to infer from
541+ the file extension and the ` "type" ` field in the nearest parent ` package.json ` .
520542
521- Valid values are ` "commonjs" ` and ` "module" ` , where the default is to infer
522- from the file extension and package type boundary.
543+ Works for executing a file as well as ` --eval ` , ` --print ` , ` STDIN ` .
523544
524545` -m ` is an alias for ` --type=module ` .
525546
@@ -916,7 +937,8 @@ greater than `4` (its current default value). For more information, see the
916937[ debugger ] : debugger.html
917938[ debugging security implications ] : https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
918939[ emit_warning ] : process.html#process_process_emitwarning_warning_type_code_ctor
919- [ experimental ECMAScript Module ] : esm.html#esm_experimental_loader_hooks
940+ [ experimental ECMAScript Module ] : esm.html#esm_resolve_hook
941+ [ customizing esm specifier resolution ] : esm.html#esm_customizing_esm_specifier_resolution_algorithm
920942[ libuv threadpool documentation ] : http://docs.libuv.org/en/latest/threadpool.html
921943[ remote code execution ] : https://www.owasp.org/index.php/Code_Injection
922944[ secureProtocol ] : tls.html#tls_tls_createsecurecontext_options
0 commit comments