diff --git a/doc/api/esm.md b/doc/api/esm.md index c9cc4e88c7c2bb..4381f66d1a4b93 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -637,6 +637,12 @@ CommonJS entry point for `require`. } ``` +The above example uses explicit extensions `.mjs` and `.cjs`. +If your files use the `.js` extension, `"type": "module"` will cause such files +to be treated as ES modules, just as `"type": "commonjs"` would cause them +to be treated as CommonJS. +See [Enabling](#esm_enabling). + ```js // ./node_modules/pkg/index.cjs exports.name = 'value';