diff --git a/doc/api/esm.md b/doc/api/esm.md index 551eef604eac0e..357226d7a690e4 100644 --- a/doc/api/esm.md +++ b/doc/api/esm.md @@ -674,6 +674,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';