How to use the browserify-zlib.gunzipSync function in browserify-zlib

To help you get started, we’ve selected a few browserify-zlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ethers-io / ethers.js / packages / testcases / lib.esm / browser.js View on Github external
export function loadTests(tag) {
    let filename = 'testcases/' + tag + ".json.gz";
    if (Cache[filename] == null) {
        console.log("loading:", filename);
        Cache[filename] = JSON.parse(zlib.gunzipSync(new Buffer(data[filename], "base64")).toString());
    }
    return Cache[filename];
}
export function loadData(filename) {
github ethers-io / ethers.js / packages / testcases / lib.esm / index.js View on Github external
export function loadTests(tag) {
    let filename = path.resolve(__dirname, '../testcases', tag + '.json.gz');
    return JSON.parse(zlib.gunzipSync(fs.readFileSync(filename)).toString());
}
export function loadData(filename) {
github ethers-io / ethers.js / packages / testcases / src.ts / index.ts View on Github external
export function loadTests(tag: string): any {
   let filename = path.resolve(__dirname, '../testcases', tag + '.json.gz');
   return JSON.parse(zlib.gunzipSync(fs.readFileSync(filename)).toString());
}
github UWNetworksLab / uProxy-p2p / src / lib / bridge / onetime.ts View on Github external
export var decode = (encoded:string) : Object[] => {
  var decoded = new Buffer(encoded, 'base64');
  var uncompressedBuffer :Buffer;
  try {
    uncompressedBuffer = zlib.gunzipSync(decoded);
  } catch (e) {
    log.debug('gzip failed, assuming uncompressed messages');
    uncompressedBuffer = decoded;
  }
  var json = uncompressedBuffer.toString();
  return JSON.parse(json);
};

browserify-zlib

Full zlib module for the browser

MIT
Latest version published 8 years ago

Package Health Score

71 / 100
Full package analysis

Popular browserify-zlib functions