nl_tokens: Main entrance function will create PipeStream or joined pipe based on input
pl_tokens: function createPipeStream ( cmd /*, args, opts*/ ) { var proc ; var <mask> ; if ( Array . isArray ( cmd ) ) { // We have an array so create a pipe from all elements var firstCmd = cmd . shift ( ) ; var open = Array . isArray ( firstCmd ) ? createPipeStream . apply ( { } , firstCmd ) : createPipeStream ( firstCmd ) ; cmd . forEach ( function ( p ) { open = open . pipe ( p ) ; } ) ; return open ; } else if ( cmd instanceof EventEmitter ) { // Take the eventemitter as base proc = cmd ; command = 'pre-defined' ; } else if ( typeof cmd === 'object' ) { throw new TypeError ( 'Invalid input, expected object type -> EventEmitter' ) ; } else { // We have input for Spawn command, normalize the input and create spawn var input = utils . normalizeInput . apply ( this , arguments ) ; command = utils . getCommand ( input ) ; proc = spawn . apply ( { } , input ) ; } // Create inner pointer for command proc . _command = command ; // Check if process is still alive if ( proc . exitCode ) { throw new Error ( 'Process already dead' ) ; } return PipeStream ( proc ) ; }