virtual-leveldown
v1.0.1
Published
Use a leveldb instance virtually without changing the original
Downloads
6
Readme
virtual-leveldown
Windows | Mac/Linux ------- | --------- |
LevelDOWN drop-in replacement that reads from a leveldb store, but writes to memory. It behaves like a leveldown, but all changes (put / del) are only made in memory, so that the original leveldb instance remains unchanged.
Install with npm install virtual-leveldown
Note that this is only a 3-lines tiny wrapper around virtualdown, that already ships with leveldown.
example
var virtualDOWN = require('virtual-leveldown')
var db = virtualDOWN('mydatabase') // filled with cats
db.open(function () {
db.put('doggy', 'dogdog', function (err) {
db.get('doggy', function (value) {
// value == 'dogdog'
// but the dog is not in 'mydatabase' on disk
})
})
})