cachedown
leveldown with a cache, for fast puts and gets
Usage
var slow = require('leveldown')
var fast = require('cachedown')
var levelup = require('levelup')
var db = levelup('./db.db', {
db: function (location) {
return fast(location, slow)
}
})
db.put('hey', 'ho', function (err) {
db.get('hey', function (err, val) {
console.log(val)
})
})
Misc
var leveldown = require('leveldown')
var levelup = require('levelup')
var cachedown = require('cachedown')
cachedown.setLeveldown(leveldown)
var db = levelup('path/to/db', { db: cachedown })
var cachedownInstance = new cachedown('path/to/db')
cachedownInstance.maxSize(100)
cachedownInstance.clearCache()