Skip to content

Instantly share code, notes, and snippets.

@hgwood
Created August 23, 2016 13:38
Show Gist options
  • Save hgwood/59ef7adebeecd9ddbffaad7231f336e8 to your computer and use it in GitHub Desktop.
Save hgwood/59ef7adebeecd9ddbffaad7231f336e8 to your computer and use it in GitHub Desktop.
Zipping files using Node.js
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