Skip to content

Instantly share code, notes, and snippets.

@kkaefer
Created May 13, 2014 09:01
Show Gist options
  • Save kkaefer/3e7e39a84cddd701f7f6 to your computer and use it in GitHub Desktop.
Save kkaefer/3e7e39a84cddd701f7f6 to your computer and use it in GitHub Desktop.
CLI app for inflating files
#!/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