The sample data can be found here allCountries.zip, it's the Postal Code database form geonames.org.
I'm running this code,
const zlib = require('zlib');
const fs = require('fs');
const zip = fs.readFileSync('/tmp/allCountries.zip');
zlib.gunzip(zip, unzipData => console.log(unzipData) );
I'm getting this error,
{ Error: incorrect header check
at Zlib._handle.onerror (zlib.js:356:17) errno: -3, code: 'Z_DATA_ERROR' }
I've also tried zlib.unzip
which returns the same error, and zlib.unzipSync
like this,
zlib.unzip(zip, unzipData => console.log(unzipData) );
which returns this stack dump,
zlib.js:536
throw error;
^
Error: incorrect header check
at Zlib._handle.onerror (zlib.js:356:17)
at Unzip.Zlib._processChunk (zlib.js:526:30)
at Object.<anonymous> (/tmp/test.js:6:6)
at Module._compile (module.js:574:32)
at Object.Module._extensions..js (module.js:583:10)
at Module.load (module.js:491:32)
at tryModuleLoad (module.js:450:12)
at Function.Module._load (module.js:442:3)
at Module.runMain (module.js:608:10)
at run (bootstrap_node.js:382:7)
I'm using v7.0.0-test2016100609987d242b
, but I've confirmed this is the same result with v6.7.0
. This archive extracts properly with gunzip -c
and unzip
.
$ unzip -v ./allCountries.zip
Archive: ./allCountries.zip
Length Method Size Cmpr Date Time CRC-32 Name
-------- ------ ------- ---- ---------- ----- -------- ----
96309121 Defl:N 12668483 87% 2016-10-10 03:05 0666ed3f allCountries.txt
-------- ------- --- -------
96309121 12668483 87% 1 file