We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24faa37 commit 7f9ccd6Copy full SHA for 7f9ccd6
doc/api/esm.md
@@ -16,19 +16,19 @@ code for reuse. Modules are defined using a variety of [`import`][] and
16
The following example of an ES module exports a function:
17
18
```js
19
-// addTwo.js
+// addTwo.mjs
20
function addTwo(num) {
21
return num + 2;
22
}
23
24
export { addTwo };
25
```
26
27
-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`:
28
29
30
-// app.js
31
-import { addTwo } from './addTwo.js';
+// app.mjs
+import { addTwo } from './addTwo.mjs';
32
33
// Prints: 6
34
console.log(addTwo(4));
0 commit comments