3 ms·
Zeke mentions this in the comments[0] on the article: >The console functions are synchronous when the destination is a terminal or a file (to avoid lost messag
by nprescott 10y ago
Zeke mentions this in the comments[0] on the article:
>The console functions are synchronous when the destination is a terminal or a file (to avoid lost messages in case of premature exit) and asynchronous when it’s a pipe (to avoid blocking for long periods of time).
Which still seems to be the case in the LTS[1].
[0]: http://micheljansen.org/blog/entry/1698#comment-522124 http://micheljansen.org/blog/entry/1698#comment-522124
[1]: https://nodejs.org/dist/latest-v4.x/docs/api/console.html#console_asynchronous_vs_synchronous_consoles https://nodejs.org/dist/latest-v4.x/docs/api/console.html#co...
- k__ 10y agoSo, always pipe before write?