Skip to content

Instantly share code, notes, and snippets.

@cpietsch

cpietsch/download.js

Created Dec 19, 2018
Embed
What would you like to do?
nodejs script to download images from a csv file
var fsPromises = require('fs').promises
var dsv = require('d3-dsv');
var download = require('download');
async function all(){
let data = dsv.csvParse(await fsPromises.readFile("data.csv", { encoding: "utf8" }))
for(let entry of data) {
console.log(entry.url, entry.id)
await download(entry.url, "images", {filename: entry.id + ".jpg"})
}
}
all()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.