Use a leveldb instance virtually without changing the original

Usage no npm install needed!

<script type="module">
  import virtualLeveldown from '';



Windows Mac/Linux
Windows Build status Build 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.


var virtualDOWN = require('virtual-leveldown')

var db = virtualDOWN('mydatabase') // filled with cats () {
    db.put('doggy', 'dogdog', function (err) {
      db.get('doggy', function (value) {
        // value == 'dogdog'
        // but the dog is not in 'mydatabase' on disk