ES5 Module Systems (was: Alternative proposal to privateName.public)

Jake Verbaten raynos2 at
Mon Dec 26 14:02:41 PST 2011

> However, I am confused by the "module.exports = ..." part of your
> boilerplate. The main CommonJS wiki seems down at the moment, but looking
> at <>
> on the mirror site, I could not find any support for this idiom. The
> closest I could find was <
> which suggests it should read "module.setExports(...);" instead. Where does
> "module.exports = ..." come from?

module.exports = ... is a mechanism in node.js to overwrite the exports
object entirely. (useful when you want to export, say a function rather
then an object)

It seems to be similar to module.setExports and is there purely to support
the implementation of the module system in node.js
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list