Sha256: 2a5021ea2111ee034ba0ecbaee45c5ff54a0defdec4d6b1917111aeba8ac40ac
Contents?: true
Size: 693 Bytes
Versions: 5
Compression:
Stored size: 693 Bytes
Contents
'use strict'; const common = require('../common'); const assert = require('assert'); const zlib = require('zlib'); const data = Buffer.concat([ zlib.gzipSync('abc'), zlib.gzipSync('def') ]); const resultBuffers = []; const unzip = zlib.createUnzip() .on('error', (err) => { assert.ifError(err); }) .on('data', (data) => resultBuffers.push(data)) .on('finish', common.mustCall(() => { assert.deepStrictEqual(Buffer.concat(resultBuffers).toString(), 'abcdef', 'result should match original string'); })); for (let i = 0; i < data.length; i++) { // Write each single byte individually. unzip.write(Buffer.from([data[i]])); } unzip.end();
Version data entries
5 entries across 4 versions & 1 rubygems