News for hackers. Stuff that matters.
Re:Your first Node.js module by tferris on Monday May 28, 2012 @04:14AM (#4032449)
> Writing `exports = module.exports = ...` ensures they have the same value as you would expect.

But where should they have the same value? I thought require returns just module.exports if it exists and ignores exports.

Re:Your first Node.js module by secoif on Monday May 28, 2012 @08:24AM (#4033009)
'this' is also the same as exports. Initially, they all have the same value, they all point at the same object. If you assign module.exports to a new object (vs simply adding properties to the existing object) it will ignore the value of exports and this.

It's incredibly confusing and they should have just picked one way to export data, instead of three.