What is the difference between .js and .mjs files?
问题 I have started working on an existing project based on nodejs. I was just trying to understand the flow of execution, where I encountered with some .mjs files. I have searched the web where I found that these are module based JS files. I want to know how is it different from .js files (how does it benefit) ? 回答1: Node.js's native module system is CommonJs. It has experimental support for the standard ES6 module system and using a .mjs file extension is part of one way to trigger that support.