Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Understanding Node.js modules: multiple requires return the same object?
- // app.js
- var a = require('./a');
- a.b = 2;
- console.log(a.b); //2
- var b = require('./b');
- console.log(b.b); //2
- // a.js
- exports.a = 1;
- // b.js
- module.exports = require('./a');
Advertisement
Add Comment
Please, Sign In to add comment