Skip to content

Instantly share code, notes, and snippets.

@dexteryy
Created November 15, 2016 13:25
Show Gist options
  • Save dexteryy/d70007a9910fa7e482d04d9ebd5c9cc3 to your computer and use it in GitHub Desktop.
Save dexteryy/d70007a9910fa7e482d04d9ebd5c9cc3 to your computer and use it in GitHub Desktop.
node.js question
// a.js
var b = require('./b');
b.a.b = 4;
module.exports = b.a;
// b.js
exports.a = { a: 1, b: 2 };
// c.js
var b = require('./b');
b.a = 3;
exports.a = b;
// main.js
var a = require('./a');
var b = require('./b');
var c = require('./c');
console.log(a, b, c);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment