Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pfrazee/autobee
An experiment with Autobase and Hyperbee
https://github.com/pfrazee/autobee
Last synced: 11 days ago
JSON representation
An experiment with Autobase and Hyperbee
- Host: GitHub
- URL: https://github.com/pfrazee/autobee
- Owner: pfrazee
- Created: 2021-11-02T15:04:23.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-11-08T18:56:15.000Z (about 3 years ago)
- Last Synced: 2024-10-30T15:54:45.499Z (about 2 months ago)
- Language: JavaScript
- Size: 158 KB
- Stars: 2
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Autobee
**This is an experiment and should not be used yet!**
A multiwriter Hyperbee comprised of multiple input Hyperbees using Autobase and Hypercore 10 (all alpha software).
```js
import Corestore from 'corestore'
import ram from 'random-access-memory'
import Autobee from 'autobee' // not actually publishedconst store = new Corestore(ram)
const writer1 = store.get({ name: 'writer1' })
const writer2 = store.get({ name: 'writer2' })
const index = store.get({ name: 'index' })await writer1.ready()
await writer2.ready()const autobee = new Autobee({inputs: [writer1, writer2], defaultInput: writer1, indexes: index})
await autobee.ready()await autobee.put('a', 'writer1')
await autobee.put('b', 'writer1')
await autobee.get('a') => // {value: 'writer1', ...}
await autobee.get('b') => // {value: 'writer1', ...}await autobee.bee(writer2).put('a', 'writer2')
await autobee.get('a') => // {value: 'writer2', ...}
await autobee.get('b') => // {value: 'writer1', ...}await autobee.bee(writer2).del('a')
await autobee.del('a')
await autobee.get('a') => // null
await autobee.get('b') => // null
```See the examples folder for more.
## License
MIT