How to use the zlib.gzipSync function in zlib

To help you get started, we’ve selected a few 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 N0taN3rd / node-warc / lib / writers / warcWriterBase.js View on Github external
return new Promise((resolve, reject) => {
      if (this.opts.gzip) {
        // we're in gzipped mode - GZip the buffer
        recordBuffer = zlib.gzipSync(recordBuffer)
      }

      if (!this._warcOutStream.write(recordBuffer, 'utf8')) {
        this._warcOutStream.once('drain', resolve)
      } else {
        resolve()
      }
    })
  }
github Verivox / lighthouse-monitor / src / receivers / directory.js View on Github external
_save(target, content) {
        const compressed = zlib.gzipSync(content)
        fs.writeFileSync(target + '.gz', compressed)
    }
}

zlib

Simple, synchronous deflate/inflate for buffers

Unrecognized
Latest version published 13 years ago

Package Health Score

56 / 100
Full package analysis