Skip to content

Instantly share code, notes, and snippets.

@gladchinda
Created May 13, 2019 18:58
Show Gist options
  • Save gladchinda/0c4dc5c0a50dc0e1b0b9c4edc26f51d2 to your computer and use it in GitHub Desktop.
Save gladchinda/0c4dc5c0a50dc0e1b0b9c4edc26f51d2 to your computer and use it in GitHub Desktop.
fetch('https://picsum.photos/list')
.then(response => response.json())
.then(data => data.filter(squareImages))
.then(collectionToCSV(exportFields))
.then(csv => {
const blob = new Blob([csv], { type: 'text/csv' });
downloadBlob(blob, 'photos.csv');
})
.catch(console.error);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment