buffster

v0.1.2
A dead-simple wrapper for building and reading nodejs Buffers
buffer serialize parse

Buffster

A dead-simple wrapper for building and reading nodejs Buffers

NPM

Installation

pnpm i buffster

Usage

import { BufferBuilder, BufferWithPointer } from "buffster"

const c = new BufferBuilder()
// methods are fluent, but mutate the builder
c.uint8(6).string("hello", "utf8")
const buf = c.result()
console.log(buf) // <Buffer 06 68 65 6c 6c 6f>

const r = new BufferWithPointer(buf)
console.log(r.uint8()) // 6
console.log(r.string(r.remaining())) // hello
console.log(r.remaining()) // 0
npm i buffster

Metadata

  • MIT
  • Whatever
  • Mihail Malo
  • released 3/17/2019

Downloads

Maintainers