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

0.3.0 • Public • Published

BootBuffer

GitHub Actions status Coverage status npm version Join the chat at https://gitter.im/heineiuo/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

Readme

Keywords

none

Package Sidebar

Install

npm i bootbuffer

Weekly Downloads

10

Version

0.3.0

License

MIT

Unpacked Size

51.6 kB

Total Files

9

Last publish

Collaborators

  • heineiuo