{"bugs":{"url":"https://github.com/libp2p/js-libp2p-floodsub/issues"},"dist":{"shasum":"661f7e542d7a77ecd929fee17da61eaa3184e6b3","tarball":"https://registry.npmjs.org/libp2p-floodsub/-/libp2p-floodsub-0.21.0.tgz","fileCount":11,"integrity":"sha512-Rp3lBEZ12BJG2f7pGVXsXX9dEuxlGgbla4ixIDw5zbgU3m30HcyfVE/CFlnfIEZlkNyCxSVg0U7oZ7m+ovnKtA==","signatures":[{"sig":"MEUCIQCPIfKWfwestUPxL6VbZYghxMPZtEYN51QZee74Mq4lSQIgYgQE9hhkRYsIOvDij2YuPD4pXgun0+t9wwvbcFgaUP8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":4677386,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoUJmCRA9TVsSAnZWagAA5wUQAISmPt7OS5llfBdrjcUY\nzg8Is0ujreceqF6T0U5Y+l1QfvC0MxAAPlh+SP2Mw3d5qfbJNljgb0yLyDW7\nHi8ZqCbdkegndaB4sU8go78jNgdL8ESjsVK37ozXSmlbjjimsD07GwLbzSjw\nKn+SD2EDxxLHvqScMtkfH9waf4yQRqpv4idQaKXaDbuxVJzfikhm4eyaj7FR\nZSU7W55fVnBMr7gxVnfAbzjju53G1fELnFeJkExvM2kVAglawGhN6ljOPaSU\nRTrc8RmtWDAJlJpaHyYSoApF9Jmcly1y+9WiGccm9rFBor4DSgw69IK+0NQ5\nueqzKWtM5uyBja74F0aX0l9ODblHkkgg58ibQ6PbxxSGxug0dVtomAdM2WfC\ndeo8FhyM0jSnx5Ar8nCc/s6/rbNtYZb5tM/gnpVWEP9tPDLJgFw03u2pn6gu\nqlTKmbUqsuhQ2tVAmo9pH1U34I48cU4HSqpnEPmYJvHgYlBuglPw2luiOTWB\n+C3J0gIOtJTqrO9gHfzTUv1kP3C1ZOlf8BD+3H0Xv2d+e37+/5WRA98LmuUe\ny2sFX+qiy/v71Fed62JXRX3crBUy5pT6tq6UBSU6/50CVbWO8MvJ0AQvV0Ff\nhHAYeZTbeHBR0qkbc80HRX8FEhgcCd/xMExKIInzRtHsxFzCWn9tY5n50sHA\ncUAc\r\n=44R4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.js","name":"libp2p-floodsub","readme":"js-libp2p-floodsub\n==================\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://protocol.ai)\n[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)\n[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)\n[![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-floodsub/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-floodsub?branch=master)\n[![Travis CI](https://travis-ci.org/libp2p/js-libp2p-floodsub.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-floodsub)\n[![Circle CI](https://circleci.com/gh/libp2p/js-libp2p-floodsub.svg?style=svg)](https://circleci.com/gh/libp2p/js-libp2p-floodsub)\n[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-floodsub.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-floodsub) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n[![](https://img.shields.io/badge/pm-waffle-yellow.svg?style=flat-square)](https://waffle.io/libp2p/js-libp2p-floodsub)\n\n> 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).\n\n## Lead Maintainer\n\n[Vasco Santos](https://github.com/vasco-santos).\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n- [Events](#events)\n- [Contribute](#contribute)\n- [License](#license)\n\n## Install\n\n```sh\n> npm install libp2p-floodsub\n```\n\n## Usage\n\n```JavaScript\nconst FloodSub = require('libp2p-floodsub')\n\n// registrar is provided by libp2p\nconst fsub = new FloodSub(peerId, registrar, options)\n\nawait fsub.start()\n\nfsub.on('fruit', (data) => {\n  console.log(data)\n})\nfsub.subscribe('fruit')\n\nfsub.publish('fruit', new Buffer('banana'))\n```\n\n## API\n\n### Create a floodsub implementation\n\n```js\nconst options = {…}\nconst floodsub = new Floodsub(peerId, registrar, options)\n```\n\nOptions is an optional object with the following key-value pairs:\n\n* **`emitSelf`**: boolean identifying whether the node should emit to self on publish, in the event of the topic being subscribed (defaults to **false**).\n\nFor the remaining API, see https://github.com/libp2p/js-libp2p-pubsub\n\n## Events\n\nFloodsub emits two kinds of events:\n1. `<topic>` when a message is received for a particular topic\n  ```Javascript\n    fsub.on('fruit', (data) => { ... })\n  ```\n  - `data`: a Buffer containing the data that was published to the topic\n2. `floodsub:subscription-change` when the local peer receives an update to the subscriptions of a remote peer.\n  ```Javascript\n    fsub.on('floodsub:subscription-change', (peerId, topics, changes) => { ... })\n  ```\n  - `peerId`: a [PeerId](https://github.com/libp2p/js-peer-id) object\n  - `topics`: the topics that the peer is now subscribed to\n  - `changes`: an array of `{ topicID: <topic>, subscribe: <boolean> }`\n     eg `[ { topicID: 'fruit', subscribe: true }, { topicID: 'vegetables': false } ]`\n\n## Contribute\n\nFeel free to join in. All welcome. Open an [issue](https://github.com/libp2p/js-libp2p-pubsub/issues)!\n\nThis repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\n## License\n\nCopyright (c) Protocol Labs, Inc. under the **MIT License**. See [LICENSE file](./LICENSE) for details.\n","gitHead":"d71bfd3a48b562032ae0e165b988a5a4482a1cd5","license":"MIT","scripts":{"docs":"aegir-docs","lint":"aegir lint","test":"aegir test","build":"aegir build","release":"aegir release --docs","coverage":"aegir coverage","test:node":"aegir test -t node","test:browser":"aegir test -t browser","release-major":"aegir release --type major --docs","release-minor":"aegir release --type minor --docs","coverage-publish":"aegir coverage --provider coveralls"},"_npmUser":{"name":"vascosantos","email":"vasco.santos@moxy.studio"},"homepage":"https://github.com/libp2p/js-libp2p-floodsub#readme","keywords":["IPFS","libp2p","pubsub","gossip","flood","flooding"],"pre-push":["lint"],"repository":{"url":"git+https://github.com/libp2p/js-libp2p-floodsub.git","type":"git"},"_npmVersion":"6.13.4","description":"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).","directories":{},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"_nodeVersion":"12.14.0","contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"dirkmc","email":"dirk@mccormick.cx"},{"name":"Jacob Heun","email":"jacobheun@gmail.com"},{"name":"Pedro Teixeira","email":"i@pgte.me"},{"name":"Gavin McDermott","email":"gavinmcdermott@gmail.com"},{"name":"Cayman","email":"caymannava@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"},{"name":"Alex Potsides","email":"alex@achingbrain.net"},{"name":"Dmitriy Ryajov","email":"dryajov@gmail.com"},{"name":"Hugo Dias","email":"mail@hugodias.me"},{"name":"Mikerah","email":"mikerah14@gmail.com"},{"name":"Yusef Napora","email":"yusef@napora.org"},{"name":"wanderer","email":"mjbecze@gmail.com"},{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"}],"dependencies":{"debug":"^4.1.1","p-map":"^3.0.0","it-pipe":"^1.0.1","peer-id":"~0.13.3","protons":"^1.0.1","time-cache":"^0.3.0","libp2p-pubsub":"^0.5.0","async.nexttick":"^0.5.2","it-length-prefixed":"^3.0.0"},"_hasShrinkwrap":false,"leadMaintainer":"Vasco Santos <vasco.santos@moxy.studio>","readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","aegir":"^21.2.0","sinon":"^9.0.1","lodash":"^4.17.15","it-pair":"^1.0.0","p-defer":"^3.0.0","benchmark":"^2.1.4","multiaddr":"^7.1.0","chai-spies":"^1.0.0","dirty-chai":"^2.0.1","detect-node":"^2.0.4"},"_npmOperationalInternal":{"tmp":"tmp/libp2p-floodsub_0.21.0_1587626597500_0.6518131046135391","host":"s3://npm-registry-packages"},"_id":"libp2p-floodsub@0.21.0","version":"0.21.0"}