From ca81af7d734f98ce1cced5041b3b6ad28d1bf790 Mon Sep 17 00:00:00 2001 From: Geoffrey Booth Date: Sun, 19 Jan 2020 07:56:43 -0800 Subject: [PATCH] module: correct docs about when extensionless files are supported PR-URL: https://github.com/nodejs/node/pull/31415 Reviewed-By: Guy Bedford Reviewed-By: Gus Caplan Reviewed-By: Bradley Farias Reviewed-By: Rich Trott --- doc/api/esm.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index 1a85b57ceee19e..1fdfd8c247b111 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -33,9 +33,9 @@ initial input, or when referenced by `import` statements within ES module code: * Files ending in `.mjs`. -* Files ending in `.js`, or extensionless files, when the nearest parent - `package.json` file contains a top-level field `"type"` with a value of - `"module"`. +* Files ending in `.js`, or extensionless files when run as main entry points on + the command line, when the nearest parent `package.json` file contains a + top-level field `"type"` with a value of `"module"`. * Strings passed in as an argument to `--eval` or `--print`, or piped to `node` via `STDIN`, with the flag `--input-type=module`. @@ -50,9 +50,9 @@ or when referenced by `import` statements within ES module code: * Files ending in `.cjs`. -* Files ending in `.js`, or extensionless files, when the nearest parent - `package.json` file contains a top-level field `"type"` with a value of - `"commonjs"`. +* Files ending in `.js`, or extensionless files when run as main entry points on + the command line, when the nearest parent `package.json` file contains a + top-level field `"type"` with a value of `"commonjs"`. * Strings passed in as an argument to `--eval` or `--print`, or piped to `node` via `STDIN`, with the flag `--input-type=commonjs`.