Skip to content
This repository was archived by the owner on Apr 16, 2020. It is now read-only.

Commit 85e80fe

Browse files
GeoffreyBoothMylesBorins
authored andcommitted
doc: esm flags, package scope and file extensions rules
1 parent c7e5fe0 commit 85e80fe

File tree

2 files changed

+417
-164
lines changed

2 files changed

+417
-164
lines changed

doc/api/cli.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -513,13 +513,13 @@ Track heap object allocations for heap snapshots.
513513

514514
### `-m`, `--type=type`
515515

516-
When using `--experimental-modules`, this informs the module resolution type
517-
to interpret the top-level entry into Node.js.
516+
Used with `--experimental-modules`, this configures Node.js to interpret the
517+
initial entry point as CommonJS or as an ES module.
518518

519-
Works with stdin, `--eval`, `--print` as well as standard execution.
519+
Valid values are `"commonjs"` and `"module"`. The default is to infer from
520+
the file extension and the `"type"` field in the nearest parent `package.json`.
520521

521-
Valid values are `"commonjs"` and `"module"`, where the default is to infer
522-
from the file extension and package type boundary.
522+
Works for executing a file as well as `--eval`, `--print`, `STDIN`.
523523

524524
`-m` is an alias for `--type=module`.
525525

0 commit comments

Comments
 (0)