Hi Jann,
It starts to make more sense now. However, what is the purpose of having
module.exports.notdefault? Is notdefault a reserved name? Or was it mentioned
for illustrative purposes?
Thanks again,
-- Tito
On Mar 4, 2012, at 8:07 AM, Jann Horn wrote:
> Am Sonntag, den 04.03.2012, 06:13 -0300 schrieb Tito Ciuro:
>> He replied with: "@titusmagnus module.exports = function default () {}.
>> module.exports.notdefault = function () {}"
>>
>> I'm fairly new to Node and I don't really know how to implement a module
>> with this syntax. As a matter of fact, I haven't been able to find any
>> related documentation. What is the purpose of default() and notdefault()? Is
>> there a page where I can see this in action? A real example would be awesome.
>
> a.js
> ===================
> module.exports = function foo() {
> console.log("foo!")
> }
>
> module.exports.bar = function bar() {
> console.log("qux!")
> }
>
>
> b.js
> ===================
> var a = require('./a.js')
> a() // prints "foo!"
> a.bar() // prints "qux!"
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en