0.3.0 • Published 4 years ago

bootbuffer v0.3.0

Weekly downloads
6
License
MIT
Repository
github
Last release
4 years ago

BootBuffer

A binary-encoded serialization, for dababase columns, data transfer and others.

Get Started

import { BootBuffer } from 'bootbuffer' // install from npm

const bb = new BootBuffer()
bb.add('foo', 'bar')
bb.add('int8', 13)
bb.add('float', 13.2456741)
bb.add('double', 13.2456741123)
bb.add('json1', { foo: 'bar' })

for await (const entry of BootBuffer.read(bb.buffer)) {
  console.log(entry.key, entry.value)
  // foo, bar
  // int8, 13
  // float, 13.2456741
  // double, 13.2456741123
  // json1, { foo: "bar" }
}

Support types

  • buffer
  • string
  • uint8
  • uint16
  • uint32
  • bigint
  • float
  • double
  • boolean
  • json

Format

ValueType<varint> | KeyLength<varint> | ValueLength<varint> | Key<Buffer> | Value<Buffer> | ...repeat |

License

MIT License