Skip to content

Count the KV pairs in a leveldb range, with additional live mode

Notifications You must be signed in to change notification settings

voltraco/level-count

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

level-count

Count the KV pairs in a leveldb range, with optional live mode.

Usage

Count once:

count(db, { gt: 'prefix' }, (err, c) => {
  // ...
})

Count continuously:

const counts = count.live(db, { gt: 'prefix' })
counts.on('value', c => {
  // ...
})
const c = counts.get()

Installation

$ npm install level-count

API

count(db[, opts], cb)

counts = count(db[, opts])

counts.get()

counts.on('count', fn)

counts.destroy()

License

MIT

About

Count the KV pairs in a leveldb range, with additional live mode

Resources

Stars

Watchers

Forks

Packages

No packages published