vendor/nexe/exe.js
function _logProgress(req) {
  req.on('response', function(resp) {
    var len = parseInt(resp.headers['content-length'], 10),
      bar = new ProgressBar('[:bar]', {
        complete: '=',
        incomplete: ' ',
        total: len,
        width: 100, // just use 100
      });

    req.on('data', function(chunk) {
      bar.tick(chunk.length);
    });
  });

  req.on('error', function(err) {
    console.log(err);
    _log('error', 'failed to download node sources,');
    process.exit(1);
  });

  return req;
}
function _logProgress(req) {
  req.on('response', function(resp) {
    var len = parseInt(resp.headers['content-length'], 10),
      bar = new ProgressBar('[:bar]', {
        complete: '=',
        incomplete: ' ',
        total: len,
        width: 100, // just use 100
      });

    req.on('data', function(chunk) {
      bar.tick(chunk.length);
    });
  });

  req.on('error', function(err) {
    console.log(err);
    _log('error', 'failed to download node sources,');
    process.exit(1);
  });

  return req;
}
function _logProgress ( req ) { req . on ( 'response' , function ( resp ) { var len = parseInt ( resp . headers [ 'content-length' ] , 10 ) , bar = new ProgressBar ( '[:bar]' , { complete : '=' , incomplete : ' ' , total : len , width : 100 , // just use 100 } ) ; req . on ( 'data' , function ( chunk ) { bar . tick ( chunk . length ) ; } ) ; } ) ; req . on ( 'error' , function ( err ) { console . log ( err ) ; _log ( 'error' , 'failed to download node sources,' ) ; process . exit ( 1 ) ; } ) ; return req ; }
Log the progress of a request object.
Log the progress of a request object .