Sosyaku
Promiseの重い処理を分割して再帰的に実行してくれるやつ。
Installation
npm i sosyaku -S
Usage
const dataList = ['https://~~~/1.jpg', ..., 'https://~~~/2000.jpg']; const task = url => { return new Promise( (resolve, reject) => { generateThumbnails(url, [30, 120, 240]) // ex .then( result => resolve(result) ) .catch( err => reject(err) ) })}; const params = { skip: 0, /* default is 0 */ limit: 20, /* default is 20 */ dataList: dataList, task: task,}; new Sosyaku(params).bite().then( result => console.log(result) );