Created
July 8, 2017 14:08
-
-
Save alcovegan/bb21d9f0760d992b677108cec13e9452 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const async = require('async'); | |
| const request = require('axios'); | |
| function iteratee(asset, cb) { | |
| request | |
| .get(`construct url with asset here`) | |
| .then(function(res) { | |
| cb(null, params); | |
| }) | |
| .catch(err => { | |
| cb(null, params); | |
| }) | |
| } | |
| async.mapLimit(assetsList, 10, iteratee, function(err, results) { | |
| if (err) throw err; | |
| fs.writeFile('results.json', JSON.stringify(results), 'utf8', (err) => { | |
| console.log('File with results written!'); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment