IndexedUp is a port of node-levelup (LevelDB driver) for the browser, backed by IndexedDB. The API should be 100% compatible with node-levelup's, allowing you to share database code between the server and client.
var indexedup = require('indexedup')
indexedup('./mydb', function(err, db){
db.put('key', 'some value', function(err){
if (err) throw err
db.get('key', function(err, value){
console.log(value)
})
})
})
indexedup()
db.open()
db.close()
db.put()
db.get()
db.del()
db.batch()
db.isOpen()
db.isClosed()
db.readStream()
db.keyStream()
db.valueStream()
db.writeStream()
Passes levelup's test/simple-test.js (http://ricardobeat.github.com/indexedup/test/levelup/) with a few changes.
The basic test suite (test/spec.coffee
) is 100% interchangeable with either node-levelup (run mocha
) or indexedup in the browser.
- deal with
options.encoding
- buffering / sync constructor
- events