Really useful comment, thanks !

To summarize, 
i m wrong to call process.exit(), 
When i need to set the process exit code, 
then i should set `process.exitCode` property (asat).

see https://nodejs.org/api/process.html#process_process_exitcode




Le mercredi 25 mai 2016 16:52:38 UTC+2, Ryan Graham a écrit :
>
> On Tue, May 24, 2016, 9:14 PM Zlatko <zlad...@gmail.com <javascript:>> 
> wrote:
>
>> On Monday, May 23, 2016 at 4:57:29 PM UTC+2, mh-cbon wrote:
>>>
>>> Hi,
>>>
>>> I m facing a badly weird issue which i can t tell if it s a bug, or an 
>>> error from my side.
>>>
>>>  
>> It's not a bug, it's a feature :)
>>
>> Seriously, *console.log* is *asynchronous*, because it can involve disk 
>> I/O (e.g you run a program but redirect the log to a file). In order not to 
>> block with such processes, console.log is made async.
>>
>> IIRC *console.error* is sync - so in this particular case you can use 
>> that. But you can also write to process.stdout and then make sure your 
>> stuff is written before you end the program.
>>
>
>
> I wish it were that simple! Both log and error were supposed to be sync, 
> unless they were redirected to files.
>
> The weirdness the original post was about is quite possibly related to the 
> the "fun" described in https://github.com/nodejs/node/issues/6456
>
> ~Ryan
> -- 
>
> ~Ryan
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/b4da9a28-cb7a-4424-9cee-15b89d9c247c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to