Created
August 23, 2016 13:38
-
-
Save hgwood/59ef7adebeecd9ddbffaad7231f336e8 to your computer and use it in GitHub Desktop.
Zipping files using Node.js
This file contains 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 yazl = require('yazl'); | |
function zip(...files) { | |
const archive = new yazl.ZipFile(); | |
files.forEach(file => archive.addFile(file, file)); | |
archive.end(); | |
return archive.outputStream; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment