JSPM

  • Created
  • Published
  • Downloads 843642
  • Score
    100M100P100Q55835F
  • License MIT

LevelDOWN wrapper supporting levelup@1 encodings

Package Exports

  • encoding-down

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (encoding-down) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

encoding-down

LevelDB Logo

abstract-leveldown wrapper supporting levelup@1 encodings. For motivation, see this issue.

Build Status Greenkeeper badge

Usage

const levelup = require('levelup')
const leveldown = require('leveldown')
const encode = require('encoding-down')
const db = levelup(encode(leveldown('./db')))
db.put('name', 'encoding-down', function (err) {
  db.get('name', function (err, value) {
    if (!err) console.log('name=', value)
  })
})

API

const db = require('encoding-down')(db[, options])

  • db abstract-leveldown compatible db such as leveldown, memdown, level-js etc
  • options.keyEncoding (string) defaults to 'utf8'
  • options.valueEncoding (string) defaults to 'utf8'

options are passed to level-codec, see supported encodings for more information.

License

MIT