Count the KV pairs in a leveldb range, with optional live mode.
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()$ npm install level-countMIT