npm install leGenerator style node interface to LevelDB.
``js
var le = require('le');
var co = require('co');
var db = le('db');
co(function*(){
yield db.set('foo', 'bar');
console.log('foo: %s', yield db.get('foo'));
})();
`
`bash`
$ npm install le
- [x] get, set, delete
- [x] batches
- [x] prefix ranges
- [x] interval ranges
- [ ] test suite
- [ ] streaming iteration
- [ ] encodings
- [ ] plugin interface (no monkey patching!)
- [ ] nesting
- [ ] client
Create or open the db at path.
Get the value at key.
Set the value at key to value.
Delete the value at key.
Create a batch.
Queue setting key to value.
Queue deleting the value at key.
Write the batch of operations.
Get all keys (inside range).
Get all values (whose keys are inside range).
Ranges
db#keys() and db#values() accept string ranges of those formats:
- ""/"*": get all"prefix*"
- : all keys must start with prefix"[from,to]"
- , "[from,to)", "(from,to]", "(from,to)": all keys must beinfinity
inside the interval, see
interval notations#Classification_of_intervals).
For to x and vice versa omit the boundary, like [,to].
For now, everything is stored as JSON`.
- want db.use() instead of monkey patching
- generators for async ops
- __generators for streams__
- efficient nesting and less verbose ranges
MIT