Created
May 13, 2014 09:01
-
-
Save kkaefer/3e7e39a84cddd701f7f6 to your computer and use it in GitHub Desktop.
CLI app for inflating files
This file contains hidden or 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
#!/usr/bin/env node | |
var zlib = require('zlib'); | |
var fs = require('fs'); | |
var inflate = zlib.createInflate(); | |
var input = process.stdin; | |
var output = process.stdout; | |
if (typeof process.argv[2] !== 'undefined') { | |
input = fs.createReadStream(process.argv[2]); | |
} | |
input.pipe(inflate).pipe(output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment