ZipCreate
Overview
ZipCreate builds a zip archive from a map of path -> contents.
Part of the archive package — Node.js analog: archiver.
Signature
go
func ZipCreate(files map[string][]byte) ([]byte, error)Compare: Node.js · Standard Go · gox
js
// Typical archiver pattern in Node.jsgo
// archive/zip or archive/tar from stdlibgo
import "github.com/sahilkhaire/gox/archive"
err := archive.ZipCreate(ctx, "out.zip", entries)Example
go
import "github.com/sahilkhaire/gox/archive"
err := archive.ZipCreate(ctx, "out.zip", entries)Tips
Import github.com/sahilkhaire/gox/archive and call ZipCreate 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.