@nlocnila/lsdb
v1.0.1
Published
LevelUP & localStorageDOWN
Downloads
4
Readme
lsdb
LevelUP & LocalstorageDOWN
Why
You get the benefit of both localStorage as a storage backend and a MemDB-like implementation (in-memory storage) as a fallback for the price of one package.
Install
$ npm install @nlocnila/lsdb
Usage
'use strict'
var LSDB = require('../index')
var db = LSDB('mydb')
db.put('test', 'hello world', function (err) {
if (err) {
return console.error(err)
}
db.get('test', function (err, value) {
if (err) {
return console.error(err)
}
console.log(value) // hello world
})
})
API
LSDB(location, [options], [callback])
{
location: String,
options: Object,
callback: Function
}
Initializes a new lsdb
, location
is the only parameter required. See LevelUP for more details.
db#put
db#get
db#del
Supports basic functionality implemented on top of the Abstract LevelDOWN API. See localstorage-down package for more details.
Browser Support
Check out the following link to see what is supported out of box
License
MIT