bandcamp-scraper
bandcamp-scraper copied to clipboard
Support Promise
trafficstars
var getAlbumInfo = util.promisify(bandcamp.getAlbumInfo);
async function getCollection(albums, res){
var ps = albums.map(album => getAlbumInfo(album));
return Promise.all(ps).then(collection => res.json(collection));
}
@notchris Thanks I didn't know about the util.promisify function of the Standard Lib.
I'll use it! 😀