summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGus Caplan <me@gus.host>2020-05-14 15:02:03 -0500
committerShelley Vohr <shelley.vohr@gmail.com>2020-05-17 09:01:21 -0700
commit7f9ccd6d89c869541bfa19988a2efb0f87de0b19 (patch)
treef7eadc5e72894206291dcff4911562f32cd71447
parent24faa37a09e5f77fe5b57d417c56d0f1a91ab215 (diff)
downloadnode-new-7f9ccd6d89c869541bfa19988a2efb0f87de0b19.tar.gz
doc: fix extension in esm example
PR-URL: https://github.com/nodejs/node/pull/33408 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Myles Borins <myles.borins@gmail.com>
-rw-r--r--doc/api/esm.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/esm.md b/doc/api/esm.md
index 365f19da58..e5c957d03c 100644
--- a/doc/api/esm.md
+++ b/doc/api/esm.md
@@ -16,7 +16,7 @@ code for reuse. Modules are defined using a variety of [`import`][] and
The following example of an ES module exports a function:
```js
-// addTwo.js
+// addTwo.mjs
function addTwo(num) {
return num + 2;
}
@@ -24,11 +24,11 @@ function addTwo(num) {
export { addTwo };
```
-The following example of an ES module imports the function from `addTwo.js`:
+The following example of an ES module imports the function from `addTwo.mjs`:
```js
-// app.js
-import { addTwo } from './addTwo.js';
+// app.mjs
+import { addTwo } from './addTwo.mjs';
// Prints: 6
console.log(addTwo(4));