Skip to content
Node: zlibgithub.com/sahilkhaire/gox/compress

GzipWriter

Overview

GzipWriter wraps dst with a gzip writer; caller must Close the writer.

Part of the compress package — Node.js analog: zlib.

Signature

go
func GzipWriter(dst io.Writer) *gzip.Writer

Compare: Node.js · Standard Go · gox

js
// Typical zlib pattern in Node.js
go
// Use the underlying stdlib or driver directly.
// See package overview for escape hatches.
go
import "github.com/sahilkhaire/gox/compress"

compress.GzipWriter(w)

Example

go
import "github.com/sahilkhaire/gox/compress"

compress.GzipWriter(w)

Tips

Import github.com/sahilkhaire/gox/compress and call GzipWriter directly. See the comparison below for the standard library equivalent.

Standard library alternative

gox wraps the Go standard library or a trusted dependency with Node-familiar naming. You can use the underlying library directly — see the package overview for escape hatches.

Back to compress package overview

MIT Licensed · Built for Node.js developers moving to Go