1. node导入包

// a.js
a=1
b=2


// 暴露单个对象或数据
// module.exports=a
// 暴露对象
module.exports={
	a,
	b
}
// b.js
a=require('./a.js')
console.log(a)

posted @ 2022-05-23 06:03  mk-备忘  阅读(51)  评论(0)    收藏  举报