1.0.1 • Published 9 years ago

virtual-leveldown v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

virtual-leveldown

WindowsMac/Linux
Windows Build statusBuild Status

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
      })
    })
})