build.js
function spawnObservable(command, args) {
  return Observable.create(observer => {
    const cmd = spawn(command, args);
    observer.next(''); // hack to kick things off, not every command will have a stdout
    cmd.stdout.on('data', (data) => { observer.next(data.toString('utf8')); });
    cmd.stderr.on('data', (data) => { observer.error(data.toString('utf8')); });
    cmd.on('close', (data) => { observer.complete(); });
  });
}
function spawnObservable(command, args) {
  return Observable.create(observer => {
    const cmd = spawn(command, args);
    observer.next(''); // hack to kick things off, not every command will have a stdout
    cmd.stdout.on('data', (data) => { observer.next(data.toString('utf8')); });
    cmd.stderr.on('data', (data) => { observer.error(data.toString('utf8')); });
    cmd.on('close', (data) => { observer.complete(); });
  });
}
function spawnObservable ( command , args ) { return Observable . create ( observer => { const cmd = spawn ( command , args ) ; observer . next ( '' ) ; // hack to kick things off, not every command will have a stdout cmd . stdout . on ( 'data' , ( data ) => { observer . next ( data . toString ( 'utf8' ) ) ; } ) ; cmd . stderr . on ( 'data' , ( data ) => { observer . error ( data . toString ( 'utf8' ) ) ; } ) ; cmd . on ( 'close' , ( data ) => { observer . complete ( ) ; } ) ; } ) ; }
Create an Observable of a spawned child process.
@param {string} command
@param {string[]} args
Create an Observable of a spawned child process .