Batch download images from JSON files using NodeJS.
- Get started by cloning or downloading this repository.
- Create a
data.json
file within the projects root directory. - Open the
index.js
file - Modify the variables within the
//Editable Content
comments - Run the download command
npm run download
{
"${your-picture-name}": "${your-picture-link}",
}
const getDownloadItem = (key) => {
return {
productImage: data[key],
productId: key
}
}
const downloadArray = Object.keys(data).map(getDownloadItem);
const totalDownloads = downloadArray.length;