Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/heapwolf/level-key
The easiest way to work with sublevels through multilevel.
https://github.com/heapwolf/level-key
Last synced: 25 days ago
JSON representation
The easiest way to work with sublevels through multilevel.
- Host: GitHub
- URL: https://github.com/heapwolf/level-key
- Owner: heapwolf
- License: mit
- Created: 2014-12-18T14:00:17.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2014-12-30T06:02:21.000Z (almost 10 years ago)
- Last Synced: 2024-10-03T08:32:59.263Z (about 1 month ago)
- Language: JavaScript
- Size: 158 KB
- Stars: 7
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SYNOPSIS
The easiest way to work with sublevels through multilevel.# MOTIVATION
- Multilevel doesn't allow you to create sublevels.
- In order to use `db.sublevel('foo')`, multilevel
maintains a list of sublevels that needs to be
up to date in the `manifest.json`.# USAGE
The same method can be used to install level-key on
the server, the method will be written to the `manifest.json`.```js
var multilevel = require('multilevel');
var net = require('net');
var key = require('level-key');var db = multilevel.client();
var con = net.connect(3000);con.pipe(db.createRpcStream()).pipe(con);
var k = key('reports', 'yearly', 'today');
var val = {};client.put(k, val, function(err) {
/* ... */
});client
.createReadStream({ gte: k, lte: k + '~' })
.on('data', function(d) {
/* ... */
});
```