Package Exports
- libp2p-floodsub
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (libp2p-floodsub) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
js-libp2p-floodsub
libp2p-floodsub, also known as pubsub-flood or just dumbsub, this implementation of pubsub focused on delivering an API for Publish/Subscribe, but with no CastTree Forming (it just floods the network).
Table of Contents
Install
> npm install libp2p-floodsub
Examples
const FloodSub = require('libp2p-floodsub')
const fsub = new FloodSub(node)
fsub.start((err) => {
if (err) {
console.log('Upsy', err)
}
fsub.on('fruit', (data) => {
console.log(data)
})
fsub.subscribe('fruit')
fsub.publish('fruit', new Buffer('banana'))
})
API
See https://libp2p.github.io/js-libp2p-floodsub
Contribute
PRs are welcome!
Small note: If editing the Readme, please conform to the standard-readme specification.
License
MIT © David Dias