1.1.1 • Published 6 months ago

tiny-buffer-map v1.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

tiny-buffer-map

A very simple Map for Buffers. Has the same API as a JS Map.

Usage

const BufferMap = require('tiny-buffer-map')
const b4a = require('b4a')

const key = b4a.from('hello')

const m = new BufferMap()
m.set(b4a.from('a'), 'b')
m.set(b4a.from('c'), 'd')
m.get(b4a.from('a')) // 'b'
m.delete(b4a.from('c'))

for (const [key, value] of m) {
  // keys are buffers in the iterators
}

License

MIT