sosyaku
v0.0.3
Published
Sosyaku ======
Downloads
2
Readme
Sosyaku
http://gifmagazine.net/post_images/488035
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) );