lib/node-squad.js
function createBatchJobs(){
                var promises = [];

                for(var i=0;i<squadSize && dataCopy.length > 0;i++){
                    var item = dataCopy.shift();
                    promises.push(worker(item));
                }
                return promises;
            }
function createBatchJobs(){
                var promises = [];

                for(var i=0;i<squadSize && dataCopy.length > 0;i++){
                    var item = dataCopy.shift();
                    promises.push(worker(item));
                }
                return promises;
            }
function createBatchJobs ( ) { var promises = [ ] ; for ( var i = 0 ; i < squadSize && dataCopy . length > 0 ; i ++ ) { var item = dataCopy . shift ( ) ; promises . push ( worker ( item ) ) ; } return promises ; }
this will create a batch of up to squadSize jobs
this will create a batch of up to squadSize jobs