Skip to content
No description or website provided.
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

lu

Simplest tool for reading a leveldb

all the code

optimist + levelup

If you want features, use lev

#! /usr/bin/env node
var opts     = require('rc')('lq', {encoding: 'json'})
var levelup  = require('levelup')
var sublevel = require('level-sublevel')
var path     = require('path')

var db = sublevel(levelup(path.resolve(opts._[0] || '.'), opts))

if(opts.max)
  opts.max = opts.max.split('\\xff').join('\xff')
if(opts.min)
  opts.min = opts.min.split('\\xff').join('\xff')
if(opts.pre)
  opts.pre = opts.pre.split('\\xff').join('\xff')

if(opts.pre) {
  opts.min = opts.pre
  opts.max = opts.pre + '\xff'
}

if(opts.all) { //read
  opts.min = '',
  opts.max = '\xff\xff\xff'
}

db.createReadStream({
  min: opts.min,
  max: opts.max,
  reverse: opts.reverse
})
.on('data', console.log)

License

MIT

Something went wrong with that request. Please try again.