Guest User

Untitled

a guest
Dec 10th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. const scraper = require('./scrape.js')
  2. const models = require('./models.js')
  3.  
  4. const processModels = models => Promise.all(
  5. models.map(model => processLinks(model, model.urls))
  6. ).then(
  7. result => console.log(JSON.stringify(result))
  8. )
  9.  
  10. const processLinks = (model, urls) => Promise.all(
  11. urls.map(url => scraper(model, url))
  12. )
  13.  
  14. processModels(models)
Add Comment
Please, Sign In to add comment