https://github.com/poga/object-feed
live-updating distributed javascript object
https://github.com/poga/object-feed
distributed hypercore json
Last synced: 5 months ago
JSON representation
live-updating distributed javascript object
- Host: GitHub
- URL: https://github.com/poga/object-feed
- Owner: poga
- Created: 2017-03-25T06:49:19.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-28T11:51:40.000Z (almost 9 years ago)
- Last Synced: 2025-10-14T04:06:15.018Z (5 months ago)
- Topics: distributed, hypercore, json
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# object-feed
A distributed live-updating JavaScript object.
`npm i object-feed`
## Synopsis
In one process:
```javascript
var Feed = require('object-feed')
var swarm = require('hyperdiscovery')
var feed = new Feed('./feed')
swarm(feed.feed)
feed.open(function () {
feed.set({foo: 'bar'})
console.log(feed.key.toString('hex'))
})
```
In another process:
```javascript
var feed = new Feed('./another-feed', '')
var swarm = require('hyperdiscovery')
swarm(feed.feed)
feed.on('update', function (value) {
console.log(value) // === {foo: 'bar'}
})
```
## License
MIT