Add to Chrome
✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
How to indicate to Node.js that we are creating an ES module?
Give the file a .js extension.
Add a "type" field with the value "ESM" in the package.json file.
Add a "type" field with the value "module" in the package.json file.
Add a "module" field with the value "ESM" in the package.json file.
Give the file a .cjs extension.
Give the file a .mjs extension.
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!