@@ -43,29 +43,29 @@ loaded as an ES module.
43
43
node --experimental-modules my-app.mjs
44
44
```
45
45
46
- ### <code >--type=module</code > flag
46
+ ### <code >--entry- type=module</code > flag
47
47
48
48
Files ending with ` .js ` or ` .mjs ` , or lacking any extension,
49
- will be loaded as ES modules when the ` --type=module ` flag is set.
49
+ will be loaded as ES modules when the ` --entry- type=module ` flag is set.
50
50
51
51
``` sh
52
- node --experimental-modules --type=module my-app.js
52
+ node --experimental-modules --entry- type=module my-app.js
53
53
```
54
54
55
- For completeness there is also ` --type=commonjs ` , for explicitly running a ` .js `
56
- file as CommonJS. This is the default behavior if ` --type ` is
55
+ For completeness there is also ` --entry- type=commonjs ` , for explicitly running
56
+ a ` .js ` file as CommonJS. This is the default behavior if ` --entry -type ` is
57
57
unspecified.
58
58
59
- The ` --type=module ` flag can also be used to configure Node.js to treat
59
+ The ` --entry- type=module ` flag can also be used to configure Node.js to treat
60
60
as an ES module input sent in via ` --eval ` or ` --print ` (or ` -e ` or ` -p ` ) or
61
61
piped to Node.js via ` STDIN ` .
62
62
63
63
``` sh
64
- node --experimental-modules --type=module --eval \
64
+ node --experimental-modules --entry- type=module --eval \
65
65
" import { sep } from 'path'; console.log(sep);"
66
66
67
67
echo " import { sep } from 'path'; console.log(sep);" | \
68
- node --experimental-modules --type=module
68
+ node --experimental-modules --entry- type=module
69
69
```
70
70
71
71
### <code >package.json</code > <code >"type"</code > field
@@ -420,8 +420,8 @@ to work.
420
420
421
421
<!-- eslint-skip -->
422
422
` ` ` bash
423
- node -- experimental- modules -- type= module index .js # fails
424
- node -- experimental- modules -- type= module -- experimental- json- modules index .js # works
423
+ node -- experimental- modules -- entry - type= module index .js # fails
424
+ node -- experimental- modules -- entry - type= module -- experimental- json- modules index .js # works
425
425
` ` `
426
426
427
427
## Experimental Loader hooks
@@ -576,7 +576,7 @@ of these top-level routines.
576
576
577
577
_isMain_ is **true** when resolving the Node.js application entry point.
578
578
579
- When using the ` -- type` flag, it overrides the ESM_FORMAT result while
579
+ When using the ` -- entry - type` flag, it overrides the ESM_FORMAT result while
580
580
providing errors in the case of explicit conflicts.
581
581
582
582
<details>
0 commit comments