一、模块化标准与规范CommonJS简介:CommonJS 是最早的 JavaScript 模块化标准,主要用于服务端(如 Node.js)。特点:使用 require 导入模块,使用 module.exports 或 exports 导出模块。模块是同步加载的,这在服务器环境中是合理的。示例:// module.jsconst greeting = 'Hello, World!';module.exports = greeting;// app.jsconst greeting = require('./module');console.log(greeting); // Hello, World!https://www.nowcoder.com/issue/tutorial?zhuanlanId=j572L2&uuid=34f94c51e98c43189698d5dbb201f92c