Skip to content

Instantly share code, notes, and snippets.

@harrietty
Created July 9, 2018 20:38
Show Gist options
  • Save harrietty/9d83dc6cbc4d80279fb89feee3ff40b5 to your computer and use it in GitHub Desktop.
Save harrietty/9d83dc6cbc4d80279fb89feee3ff40b5 to your computer and use it in GitHub Desktop.
const fs = require('fs');
const zlib = require('zlib');
const fileContents = fs.createReadStream('./data/file1.txt.gz');
const writeStream = fs.createWriteStream('./data/file1.txt');
const unzip = zlib.createGunzip();
fileContents.pipe(unzip).pipe(writeStream);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment