Skip to content

Instantly share code, notes, and snippets.

@stefanjudis
Last active July 28, 2016 15:48
Show Gist options
  • Save stefanjudis/0f4976ce76043e34096c7eef30b899eb to your computer and use it in GitHub Desktop.
Save stefanjudis/0f4976ce76043e34096c7eef30b899eb to your computer and use it in GitHub Desktop.
stderr & stdout order is puzzled
this.processCmd = options.isCustom ?
`npm run ${ script.name }` :
script.command;
this.$set( 'process', this.exec(
this.processCmd,
{
cwd : options.cwd
}
) );
this.process.stdout.on( 'data', this.handleData );
this.process.stderr.on( 'data', this.handleData );
//
// it seams when large data coming from stdout
// and tiny data coming from stderr
// that stderr somehow gets called first
//
// -> puzzled order in data display happening in handleData
// e.g. npm ls
// -> running `npm ls` from the terminal shows a big chunk of stdout ( the list ) and
// errors at the end
// that leads to my assumption that this is the correct order
// -> running `npm ls` from within node a child process I got
// chunks of stdout and stderr right in the middle somehwhere
// *****************************************
// is this a thing? large data ( enourmous strings ) delaying the handler call?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment