Skip to content

holepunchto/tiny-buffer-map

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A very simple Map for Buffers and Uint8Arrays

Resources

License

Stars

Watchers

Forks

Packages

No packages published