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

Commit 7efc53d

Browse files
committed
fixup: s/type/entry-type doc
1 parent 79a19d6 commit 7efc53d

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

doc/api/cli.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ added: v2.4.0
532532

533533
Track heap object allocations for heap snapshots.
534534

535-
### `--type=type`
535+
### `--entry-type=type`
536536

537537
Used with `--experimental-modules`, this configures Node.js to interpret the
538538
initial entry point as CommonJS or as an ES module.

doc/api/errors.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -2223,17 +2223,17 @@ while trying to read and parse it.
22232223

22242224
> Stability: 1 - Experimental
22252225
2226-
The `--type=...` flag is not compatible with the Node.js REPL.
2226+
The `--entry-type=...` flag is not compatible with the Node.js REPL.
22272227

22282228
<a id="ERR_TYPE_MISMATCH"></a>
22292229
### ERR_TYPE_MISMATCH
22302230

22312231
> Stability: 1 - Experimental
22322232
2233-
The `--type=commonjs` flag was used to attempt to execute an `.mjs` file or
2234-
a `.js` file where the nearest parent `package.json` contains
2233+
The `--entry-type=commonjs` flag was used to attempt to execute an `.mjs` file
2234+
or a `.js` file where the nearest parent `package.json` contains
22352235
`"type": "module"`; or
2236-
the `--type=module` flag was used to attempt to execute a `.cjs` file or
2236+
the `--entry-type=module` flag was used to attempt to execute a `.cjs` file or
22372237
a `.js` file where the nearest parent `package.json` either lacks a `"type"`
22382238
field or contains `"type": "commonjs"`.
22392239

@@ -2242,7 +2242,7 @@ field or contains `"type": "commonjs"`.
22422242

22432243
> Stability: 1 - Experimental
22442244
2245-
An invalid `--type=...` flag value was provided.
2245+
An invalid `--entry-type=...` flag value was provided.
22462246

22472247
<a id="ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK"></a>
22482248
#### ERR_MISSING_DYNAMIC_INSTANTIATE_HOOK

doc/api/esm.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -43,29 +43,29 @@ loaded as an ES module.
4343
node --experimental-modules my-app.mjs
4444
```
4545

46-
### <code>--type=module</code> flag
46+
### <code>--entry-type=module</code> flag
4747

4848
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.
5050

5151
```sh
52-
node --experimental-modules --type=module my-app.js
52+
node --experimental-modules --entry-type=module my-app.js
5353
```
5454

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
5757
unspecified.
5858

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
6060
as an ES module input sent in via `--eval` or `--print` (or `-e` or `-p`) or
6161
piped to Node.js via `STDIN`.
6262

6363
```sh
64-
node --experimental-modules --type=module --eval \
64+
node --experimental-modules --entry-type=module --eval \
6565
"import { sep } from 'path'; console.log(sep);"
6666

6767
echo "import { sep } from 'path'; console.log(sep);" | \
68-
node --experimental-modules --type=module
68+
node --experimental-modules --entry-type=module
6969
```
7070

7171
### <code>package.json</code> <code>"type"</code> field
@@ -420,8 +420,8 @@ to work.
420420
421421
<!-- eslint-skip -->
422422
```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
425425
```
426426
427427
## Experimental Loader hooks
@@ -576,7 +576,7 @@ of these top-level routines.
576576
577577
_isMain_ is **true** when resolving the Node.js application entry point.
578578
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
580580
providing errors in the case of explicit conflicts.
581581
582582
<details>

0 commit comments

Comments
 (0)