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

Made by Antonio Ramirez

level-mutex-batch

1.0.0

@mafintosh

npmHomeRepoSnykSocket
Downloads:78
$ npm install level-mutex-batch
DailyWeeklyMonthlyYearly

level-mutex-batch

Make sure only one leveldb batch is running at the time

npm install level-mutex-batch

build status

Usage

var lmbatch = require('level-mutex-batch')
var batch = lmbatch(db) // db is a levelup

batch([{type:'put', key:'hello', value:'world-1'}], function() {
  ...
})

batch([{type:'put', key:'hello', value:'world-2'}], function() {
  ...
})

batch([{type:'put', key:'hello', value:'world-3'}], function() {
  ...
})

The above example is guaranteed to always produce world-3 as the end result

License

MIT