continuous-local-storage是nodejs中类似本地存储的,它可以实现多个文件中数据共享,但是不用挂载到全局对象
//a.js
const storage=require('continuous-local-storage');
var space=stroage.createNameSpace('data');
space.set('user','xx')
//b.js
const storage=require('continuous-local-storage');
var space=storage.getNameSpace('data');
console.log(space.get('user'))
//输出xx