My favorite is #b.
---------- Forwarded message ----------
From: Jake Verbaten <rayn
...@gmail.com>
Date: Mon, Dec 26, 2011 at 2:02 PM
Subject: Re: ES5 Module Systems (was: Alternative proposal to
privateName.public)
To: "Mark S. Miller" <erig...@google.com>
Cc: Axel Rauschmayer <a...@rauschma.de>, es-discuss <es-disc...@mozilla.org>
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_SetEx...>,
> 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
--
Cheers,
--MarkM