0

I have a module test1.js, I can require it from test2.js, now I'd like to set up some global variable info that test1.js can use, what is a good approach? Thanks,

// test1.js
exports.foo = function (jcontent, cb) {
console.log('foo', this.info)
}

here is the test2.js

// test2.js
var test1 = require('./test2.js')

// set up a value in info inside test1? how?

test1.foo()
AngeloC
  • 3,213
  • 10
  • 31
  • 51

0 Answers0