Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 528 Bytes

leveldown.md

File metadata and controls

26 lines (18 loc) · 528 Bytes

LevelDB encoding using cbor-codec

See examples/leveldb/demo.cjs.

const levelup = require('levelup')
const leveldown = require('leveldown')
const encoding_down = require('encoding-down')
const cbor_leveldb = require('cbor-codec/leveldb')

const lvl_db = levelup(
  encoding_down(
    leveldown(),
    { valueEncoding: cbor_leveldb })

// or

const lvl_db = levelup(
  encoding_down(
    leveldown(),
    { keyEncoding: cbor_leveldb,
      valueEncoding: cbor_leveldb })