pakmanaged.js
function execAsync(cmd, opts, callback) {
      var output = '';
    
      var options = common.extend({
        silent: common.config.silent
      }, opts);
    
      var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) {
        if (callback)
          callback(err ? err.code : 0, output);
      });
    
      c.stdout.on('data', function(data) {
        output += data;
        if (!options.silent)
          process.stdout.write(data);
      });
    
      c.stderr.on('data', function(data) {
        output += data;
        if (!options.silent)
          process.stdout.write(data);
      });
    
      return c;
    }
function execAsync(cmd, opts, callback) {
      var output = '';
    
      var options = common.extend({
        silent: common.config.silent
      }, opts);
    
      var c = child.exec(cmd, {env: process.env, maxBuffer: 20*1024*1024}, function(err) {
        if (callback)
          callback(err ? err.code : 0, output);
      });
    
      c.stdout.on('data', function(data) {
        output += data;
        if (!options.silent)
          process.stdout.write(data);
      });
    
      c.stderr.on('data', function(data) {
        output += data;
        if (!options.silent)
          process.stdout.write(data);
      });
    
      return c;
    }
execSync() Wrapper around exec() to enable echoing output to console in real time