https://github.com/e-e-e/hyperdb-json
A json-like interface for hyperdb
https://github.com/e-e-e/hyperdb-json
Last synced: about 1 month ago
JSON representation
A json-like interface for hyperdb
- Host: GitHub
- URL: https://github.com/e-e-e/hyperdb-json
- Owner: e-e-e
- Created: 2018-07-09T12:59:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-07-09T13:03:43.000Z (over 7 years ago)
- Last Synced: 2025-09-24T12:00:15.001Z (5 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# hyperdb-json
A JSON-like interface for [hyperdb](https://github.com/mafintosh/hyperdb).
This is a simple wrapper which lets you `set` and `get` complex objects as key/value mapped prefixes in a hyperdb instance.
**TODO:**
- [ ] add support for conflicts
- [ ] overwrite old values on set
- [ ] add .delete()
- [ ] add .update()
## Installation
```bash
npm install hyperdb-json
```
### Usage
```js
var hyperdb = require('hyperdb')
var HyperJson = require('hyperdb-json')
var ram = require('random-access-memory')
var ramStore = () => ram()
var db = hyperdb(ramStore)
var json = HyperJson(db)
db.on('ready', () => {
var bar = {
x: [3, { a: 1 }],
y: {
b: ['it’s', 'good'],
c: 'ok'
}
}
hyperJson.set('foo', bar, (err) => {
hyperJson.get('foo', (err, data) => {
console.log(data)
})
})
})
```