@@ -134,6 +134,27 @@ added: v6.0.0
134
134
Enable FIPS-compliant crypto at startup. (Requires Node.js to be built with
135
135
` ./configure --openssl-fips ` .)
136
136
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 providing 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
+
137
158
### ` --experimental-modules `
138
159
<!-- YAML
139
160
added: v8.5.0
@@ -511,17 +532,16 @@ added: v2.4.0
511
532
512
533
Track heap object allocations for heap snapshots.
513
534
514
- ### ` -m ` , ` - -type=type`
535
+ ### ` --type=type `
515
536
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 .
518
539
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 ` .
520
542
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 ` .
523
544
524
- ` -m ` is an alias for ` --type=module ` .
525
545
526
546
### ` --use-bundled-ca ` , ` --use-openssl-ca `
527
547
<!-- YAML
@@ -916,7 +936,8 @@ greater than `4` (its current default value). For more information, see the
916
936
[ debugger ] : debugger.html
917
937
[ debugging security implications ] : https://nodejs.org/en/docs/guides/debugging-getting-started/#security-implications
918
938
[ emit_warning ] : process.html#process_process_emitwarning_warning_type_code_ctor
919
- [ experimental ECMAScript Module ] : esm.html#esm_experimental_loader_hooks
939
+ [ experimental ECMAScript Module ] : esm.html#esm_resolve_hook
940
+ [ customizing esm specifier resolution ] : esm.html#esm_customizing_esm_specifier_resolution_algorithm
920
941
[ libuv threadpool documentation ] : http://docs.libuv.org/en/latest/threadpool.html
921
942
[ remote code execution ] : https://www.owasp.org/index.php/Code_Injection
922
943
[ secureProtocol ] : tls.html#tls_tls_createsecurecontext_options
0 commit comments