Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ To be loaded by the Node.js `require()` function, a module must be one of the fo
- A folder with a `package.json` file containing a `"main"` field.
- A JavaScript file.

To use the `import` syntax, a module should also include `"type": "module"` in its `package.json` file:
Modern JavaScript projects can also use ES module syntax with `import` and `export`. In Node.js, ES modules are commonly enabled by setting `"type": "module"` in `package.json` or by using the `.mjs` file extension. For example, a `package.json` file can include:

```json
{
Expand Down