Skip to content

Instantly share code, notes, and snippets.

@qetr1ck-op
Created November 13, 2016 21:07
Show Gist options
  • Save qetr1ck-op/e74bede0824679159c05dcf423271a8a to your computer and use it in GitHub Desktop.
Save qetr1ck-op/e74bede0824679159c05dcf423271a8a to your computer and use it in GitHub Desktop.
const fs = require('fs');
const zlib = require('zlib');
const filename = process.argv[2];
fs.readFile(filename, (err, content) => {
zlib.gzip(content, (err, gzipedContent) => {
fs.writeFile(`${filename}.gz`, gzipedContent, err => {
console.log('file compresed');
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment