Skip to content
Node: Buffer6 APIs

buffer

Package buffer provides Node Buffer-style helpers for byte slices.

import "github.com/sahilkhaire/gox/buffer"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Functions

SymbolNode.jsKindSummary
Comparebuf.compare(other)funcCompare compares two buffers lexicographically (Buffer.compare).
Equalsbuf.equals(other)funcEquals reports whether a and b are equal (timing-safe enough for content equality).

Types

SymbolNode.jsKindSummary
BuffertypeBuffer is a byte slice with helper methods.

Methods

SymbolNode.jsKindSummary
Buffer.ConcatBuffer.concat(list)methodConcat joins buffers (Buffer.concat).
Buffer.FromBuffer.from(data)methodFrom allocates a copy of data (Buffer.from).
Buffer.FromStringBuffer.from(str)methodFromString creates a buffer from a string.

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