>
> However, I am confused by the "module.exports = ..." part of your
> boilerplate. The main CommonJS wiki seems down at the moment, but looking
> at <http://wiki.commonjs.org.mirrors.page.ca/articles/m/o/d/Modules.html>
> on the mirror site, I could not find any support for this idiom. The
> closest I could find was <
> http://wiki.commonjs.org.mirrors.page.ca/articles/m/o/d/Modules_SetExports_9215.html>,
> 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
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to