index.js
function runProc(args, cb) {
    var stoutBuffer = '',
        sterrBuffer = '';
    var proc = cp.spawn('java', args, {
        cwd: config.rootDir + '/bin'
    });
    proc.stdout.on('data', function(data) {
        stoutBuffer += data;
    });
    proc.stderr.on('data', function(data) {
        sterrBuffer += data;
    });
    proc.on('close', function(code) {
        if (code === null) {
            cb(code);
        } else {
            cb(null, stoutBuffer, sterrBuffer);
        }
        running--;
    });
}
function runProc(args, cb) {
    var stoutBuffer = '',
        sterrBuffer = '';
    var proc = cp.spawn('java', args, {
        cwd: config.rootDir + '/bin'
    });
    proc.stdout.on('data', function(data) {
        stoutBuffer += data;
    });
    proc.stderr.on('data', function(data) {
        sterrBuffer += data;
    });
    proc.on('close', function(code) {
        if (code === null) {
            cb(code);
        } else {
            cb(null, stoutBuffer, sterrBuffer);
        }
        running--;
    });
}
function runProc ( args , cb ) { var stoutBuffer = '' , sterrBuffer = '' ; var proc = cp . spawn ( 'java' , args , { cwd : config . rootDir + '/bin' } ) ; proc . stdout . on ( 'data' , function ( data ) { stoutBuffer += data ; } ) ; proc . stderr . on ( 'data' , function ( data ) { sterrBuffer += data ; } ) ; proc . on ( 'close' , function ( code ) { if ( code === null ) { cb ( code ) ; } else { cb ( null , stoutBuffer , sterrBuffer ) ; } running -- ; } ) ; }
Spawn a java process and return callback
@param  {Array}   args  arguments to pass to java proc
@param  {Function} cb   callback to be called with err, stout, sterr
Spawn a java process and return callback