buffster
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i buffster

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

10.7 kB

Total Files

7

Last publish

Collaborators

  • qm3ster