Created
October 22, 2018 14:22
-
-
Save mafintosh/cfabdae92ec4bf1e2412cec10842f7c8 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 zlib = require('zlib') | |
const { Writable } = require('stream') | |
const ts = zlib.createGzip() | |
const ws = new Writable({ | |
write (chunk, enc, cb) { | |
setImmediate(cb) | |
ts.close() | |
} | |
}) | |
const buf = Buffer.allocUnsafe(1024 * 1024 * 20) | |
ts.end(buf) | |
ts.pipe(ws) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment