From a9ed287f00fd085b0a9e8d2cfcb8ea0f7c3f1480 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 fc3ce05be0a8db..faa62b1fb87f1e 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));