1.0.1 • Published 8 years ago

@nlocnila/lsdb v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
8 years ago

lsdb

js-standard-style Build Status

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

1.0.1

8 years ago

1.0.0

8 years ago