That’s an interesting opinion, but all nodejs code I’ve ever read makes modules
this way, so that makes it the de-facto nodejs way.
On Nov 26, 2013, at 23:47, Alex Kocharin wrote:
>
> It is not a nodejs way, it's a way that default loader works (there are
> alternate loaders, and there is ES6 module system, though we don't know yet
> what impact it would have). So there is a difference.
>
> There is one reason why it is not a node.js way. It blocks. In fact, one of
> the reasons why node.js is so more popular than all other server-side js
> frameworks, and why we are all here laughing out loud at silkjs, is an async
> IO. But here it is synchronous require that uses readFileSync (which
> should've been deprecated ages ago), and flies in the face of everything
> node.js stands for.
>
> So yeah, it is rarely cause any trouble, and most of the modules are written
> in this way, but it doesn't make it nodejs way.
>
>
> On Wednesday, November 27, 2013 7:16:38 AM UTC+4, ryandesign wrote:
>> The nodejs way would be:
>>
>>
>> function SystemVersionResponse(input) {
>> // the rest of your function here
>> }
>>
>> exports.SystemVersionResponse = SystemVersionResponse;
>>
>
--
--
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
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.