So I have a helper module H, which I require
from my main script M:
M.js:
var o = {foo: 'bar'};
require('H.js').doFunc();
H.js:
module.exports = {doFunc: function(){ /* how can I set X to o.foo in M's scope? */ return X; }};
Thus one can expose things in this direction. What can I do to share things back the other way?
See Question&Answers more detail:os