nodejs-CommonJS和ECMAScript 发表于 2024-03-12 更新于 2024-03-16 require12345678910//opt.jsmodule.exports = { add,del};module.exports.a = a;//main.jsconst {add, del,a} = require('./opt') import12345//addTwo.mjsexport { addTwo };//main.jsimport { addTwo } from './addTwo.mjs';