Created
November 13, 2016 21:07
-
-
Save qetr1ck-op/e74bede0824679159c05dcf423271a8a to your computer and use it in GitHub Desktop.
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 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