Skip to content

process.stdout not blocking in node v6.0.0? #6409

@RobertWHurst

Description

@RobertWHurst
  • v6.0.0:
  • OS X 10.11.4:
  • process:

I wrote a config loader called milieu which has a feature that prints a table displaying the key, value, and value of all the config value. Here's an example from Node v5.5.0:
screen shot 2016-04-26 at 8 25 15 pm

I upgraded to Node v6.0.0 and noticed that this table now looks like this:
screen shot 2016-04-26 at 8 49 38 pm

When the library detects a --explain-config flag it prints the table and exits the program. Below is a snippet of code from the library that does the former.

...
if (this.argv['explain-config']) {
  delete this.argv['explain-config'];
  this.printExplainTable();
  process.exit(0);
}
...

Basically the printExplainTable method prints the table to process.stdout with console.log. The idea here was that stdout would block until the table is printed to the shell, then process.exit(0) is called to stop the server/program from starting.

It seems that stdout no longer blocks. If stdout does not block, is there a method to know when the stdout has been flushed? I tried using the 'drain' event the the stdout stream, but that doesn't seem to fire.

Seems like a bug. Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions