index.js
function(err) {
                if (err) {
                    // eslint-disable-next-line no-console
                    console.log("\n");
                    return Promise.reject(err);
                }

                // Get 20 files
                let _files = filesNames.splice(0, batch);

                if (_files.length) {
                    return Promise.all(_files.map(performUpload)).then(() => execStack(), execStack);
                } else {
                    return Promise.resolve();
                }
            }
function(err) {
                if (err) {
                    // eslint-disable-next-line no-console
                    console.log("\n");
                    return Promise.reject(err);
                }

                // Get 20 files
                let _files = filesNames.splice(0, batch);

                if (_files.length) {
                    return Promise.all(_files.map(performUpload)).then(() => execStack(), execStack);
                } else {
                    return Promise.resolve();
                }
            }
function ( err ) { if ( err ) { // eslint-disable-next-line no-console console . log ( "\n" ) ; return Promise . reject ( err ) ; } // Get 20 files let _files = filesNames . splice ( 0 , batch ) ; if ( _files . length ) { return Promise . all ( _files . map ( performUpload ) ) . then ( ( ) => execStack ( ) , execStack ) ; } else { return Promise . resolve ( ) ; } }
Execute stack according to `batch` option
Execute stack according to batch option