Socket
Book a DemoInstallSign in
Socket

level-shared-batch

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

level-shared-batch

Share batches and commit collectively

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

level-shared-batch

Share batches and commit collectively.

Example

var db = level('db')

// Create a shared batch object

var fork = shared(db.batch())

// Those two modules will now add their operations to a fork of the original
// batch, and batch.write(...) will mark their work as done. Once both
// modules called batch.write(), all the operations will be executed in one
// atomic go.

moduleA.doSomething({ batch: fork() })

moduleB.doAnotherThing({ batch: fork() })

Installation

$ npm install level-shared-batch

API

fork = shared(batch)

Create a new fork for batch.

fork#put(key, value)

fork#del(key)

fork#clear()

fork#write(cb)

License

MIT

FAQs

Package last updated on 30 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts