npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

level-count

1.0.0

@juliangruber

npmHomeRepoSnykSocket
Downloads:0
$ npm install level-count
DailyWeeklyMonthlyYearly

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