function hookStdout ( callback ) { let old_write = process . stdout . write ; process . stdout . write = ( ( write ) => function ( str ) { write . apply ( process . stdout , arguments ) ; callback ( str ) ; } ) ( process . stdout . write ) ; return ( ) => { process . stdout . write = old_write ; } ; } export default hookStdout ;