deferred-leveldown

A mock abstract-leveldown implementation that queues operations while a real abstract-leveldown instance is being opened

MIT 29 个版本
安装
npm install deferred-leveldown
yarn add deferred-leveldown
pnpm add deferred-leveldown
bun add deferred-leveldown
README

deferred-leveldown

A mock abstract-leveldown implementation that queues operations while a real abstract-leveldown instance is being opened.

level badge npm Node version Test Coverage Standard Common Changelog Donate

Usage

If you are upgrading: please see UPGRADING.md.

deferred-leveldown implements the abstract-leveldown API so it can be used as a drop-in replacement where leveldown is needed.

put(), get(), getMany(), del(), batch() and clear() operations are all queued and kept in memory until the abstract-leveldown-compatible object has been opened through deferred-leveldown's open() method.

batch() operations will all be replayed as the array form. Chained-batch operations are converted before being stored.

const deferred  = require('deferred-leveldown')
const leveldown = require('leveldown')

const db = deferred(leveldown('location'))

// Must always call open() first
db.open(function (err) {
  // ...
})

// But can operate before open() has finished
db.put('foo', 'bar', function (err) {
  // ...
})

Contributing

Level/deferred-leveldown is an OPEN Open Source Project. This means that:

Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.

See the Contribution Guide for more details.

Support us with a monthly donation on Open Collective and help us continue our work.

License

MIT

版本列表
7.0.0 2021-09-30
6.0.0 2021-04-17
5.3.0 2019-10-04
5.2.1 2019-09-17
5.2.0 2019-09-06
5.1.0 2019-06-22
5.0.1 2019-03-31
5.0.0 2018-12-22
4.0.2 2018-05-30
4.0.1 2018-05-22
4.0.0 2018-05-13
3.0.0 2018-02-08
2.0.3 2017-11-04
2.0.2 2017-10-06
2.0.1 2017-09-12
2.0.0-2 2015-05-28
2.0.0-1 2015-05-28
2.0.0-0 2015-05-27
2.0.0 2017-07-30
1.2.2 2017-07-30
1.2.1 2015-08-14
1.2.0 2015-05-28
1.1.0 2015-05-22
1.0.0 2015-04-28
0.3.0 2015-04-16
0.2.0 2014-04-26
0.1.0 2013-10-14
0.0.1 2013-09-30
0.0.0 2013-09-17