nl_tokens: Awaitable wrapper around child_process . spawn . Runs a command in a separate process . The output of the command is ignored . Throws when the exit code is not 0 .
pl_tokens: function ( cmd , args ) { let opts = { env : process . env } ; return new Promise ( ( resolve , reject ) => { let exe = child_process . spawn ( cmd , args , opts ) ; // suppress all output unless in verbose mode exe . stdout . on ( "data" , data => { if ( this . argv . verbose ) { console . log ( data . toString ( ) ) ; } } ) ; exe . stderr . on ( "data" , data => { if ( this . argv . verbose ) { console . error ( data . toString ( ) ) ; } } ) ; exe . on ( "close" , code => { if ( code !== 0 ) { let message = ` ${ cmd . join ( " " ) } ` ; throw new qx . tool . cli . Utils . UserError ( <mask> ) ; } else { resolve ( 0 ) ; } } ) ; exe . on ( "error" , reject ) ; } ) ; }