In Node.js, ES6 Modules have a different file extension (_________) compared to CommonJS modules (.js).

  • .mjs
  • .es6
  • .es
  • .node
Node.js uses the .mjs file extension for ES6 modules to differentiate them from CommonJS modules that typically use the .js extension. This helps Node.js to identify the module type and apply the appropriate module loading mechanism.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *