node中一个文件中引入另外一个文件的方法

1 直接通过

exports.a=a的方式

2 通过module的方式

module.exports=a

3 通过global的方式,这种方式有缓存

gloal.a = a

发布了368 篇原创文章 · 获赞 22 · 访问量 20万+

猜你喜欢

转载自blog.csdn.net/BianHuanShiZhe/article/details/104669910
今日推荐