aa.js

module.exports=function(){
	console.log("我在aa中的配置文件");
}

bb.js

testfun=require("./aa");
testfun()

js在同一目录下,都在HelloWord1下
node.js用的就是CommonJS的设计模式

相关文章:

  • 1970-01-01
  • 2021-08-17
  • 2021-09-30
  • 2021-09-16
  • 2022-12-23
  • 2021-07-11
  • 2021-10-27
  • 2021-11-17
猜你喜欢
  • 2021-12-19
  • 2021-05-05
  • 2021-06-16
  • 2022-03-08
  • 2022-12-23
  • 2022-01-13
  • 2021-08-12
相关资源
相似解决方案