Skip to content

Instantly share code, notes, and snippets.

@dcherman
Created August 22, 2012 16:46
Show Gist options
  • Save dcherman/3427357 to your computer and use it in GitHub Desktop.
Save dcherman/3427357 to your computer and use it in GitHub Desktop.
function flushExit( process, exitCode ) {
if ( process.stdout._pendingWriteReqs ) {
setTimeout(function() {
flushExit( process, exitCode );
}, 1 );
}
else {
process.exit( exitCode );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment