From 7f9ccd6d89c869541bfa19988a2efb0f87de0b19 Mon Sep 17 00:00:00 2001 From: Gus Caplan Date: Thu, 14 May 2020 15:02:03 -0500 Subject: [PATCH] doc: fix extension in esm example PR-URL: https://github.com/nodejs/node/pull/33408 Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins --- doc/api/esm.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/api/esm.md b/doc/api/esm.md index 365f19da582f5f..e5c957d03ce6a0 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));