nl_tokens: handles newly created child process via cproc . exec OR cprop . execFile ** child . on ( close ( code ) = > {} ) is basically the only event that is called ** use stdout / stderr to handle fail / done on close event !!!
pl_tokens: function _handleChild ( child , callback ) { if ( ! child ) return _ . fail ( 'Invalid child process' , callback ) if ( _ . isError ( child ) ) return _ . fail ( child , callback ) let stdout = '' let stderr = '' child . stdout . on ( 'data' , function ( data ) { stdout += data } ) child . stderr . on ( 'data' , function ( data ) { stderr += data } ) child . <mask> ( 'close' , function ( code ) { return _ . done ( stdout || stderr , callback ) } ) child . on ( 'disconnect' , function ( err ) { } ) child . on ( 'error' , function ( err ) { } ) child . on ( 'exit' , function ( code , signal ) { } ) child . on ( 'message' , function ( message , sendHandle ) { } ) return child }