{"bugs":{"url":"https://github.com/libp2p/js-libp2p-floodsub/issues"},"dist":{"shasum":"aef432f2cb61a873a6f131df733fee76be9caedd","tarball":"https://registry.npmjs.org/libp2p-floodsub/-/libp2p-floodsub-0.21.3.tgz","fileCount":8,"integrity":"sha512-TTehsDd5kZos27qmugmviF9GvzfyH8Tq2/YNBpp7Ku1KoSZugcdQAhz8hmStMtMGDkW5ysoKSBG739IhHUtgdg==","signatures":[{"sig":"MEQCIFYndzBoZJNV4XTgqUG+cPgMHGQK1Mm7Owv33piteOH4AiBLX+Xw+QyJEDIXMUOH1D995nQArtopFXWb0HsWpTKSSQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":498582,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe2LJYCRA9TVsSAnZWagAAAWIP/AmbGW6PbXmoqX6JXa7F\n0A0q3qsRRleXI5P0QNKRdLHe49sfjZm01GHS4xT0IeT2moq1+hXQMdKsxxN8\n5fXEkIYHpcmBtGC3/8aGluVGa4hWqykQfCp4TWoZM3Wu1HIyotyd/bWRJJ+J\n4KA7oaz2dqt0cBD4iuVa6VI6xEcVGQbU1kNFuU0NYgakU/jFv1WfIsQ4JiVb\nXlleDBMxUh8VZ6EqlJZ33wXZAX0c9Bjq1nz02jXByoH97KzG9UD+s7Ol+ksC\nDZNCOnMF6dBvdtkY8pYIth5jHdsUOGwaoWUFMoQ70lCNSnHPjayjbzw7nkBD\ndtC6lfalvuUCcggNsMTSDqM/az0e6NKwEjm47ejS+YunLMQ+nn2tLvtCYFic\n9O/+Vzb9SG1GqvCcCmTiEiGNDivxVdRasThMM0SDq8K1L1j+e2Tgk6upC5VJ\nW69zq60U81S5lJTcnZEQ1t4NOjIIPWFos70scSCEKDCIj8RM/RMAScPHbuwu\n7FGNZdguZTiiXG0NCSMgaa1i1kBoZEFVj7xuB3Fr5hEcgbWpucVfn1pJL5N7\n5Qc6TMzINZjAaY1cOzzNI8bGe1C0uxnfUnfS+uEleCkaFA+eZ2nC6BZIUI/J\nKk1aNRhaXkUXLnF4ng/cNBTTZ6VnklKTQTPgJZdsSrJrkNpPhhcnjdn6w8BB\nzBNT\r\n=RyG1\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":"42012136986042f92bb5290ebb30b8c9f3c4a97f","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.14.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.16.3","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":"Hugo Dias","email":"hugomrdias@gmail.com"},{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"Alex Potsides","email":"alex@achingbrain.net"},{"name":"Dmitriy Ryajov","email":"dryajov@gmail.com"},{"name":"Mikerah","email":"mikerah14@gmail.com"},{"name":"Yusef Napora","email":"yusef@napora.org"},{"name":"wanderer","email":"mjbecze@gmail.com"}],"dependencies":{"debug":"^4.1.1","p-map":"^4.0.0","buffer":"^5.6.0","it-pipe":"^1.0.1","peer-id":"~0.13.3","protons":"^1.0.1","time-cache":"^0.3.0","libp2p-pubsub":"~0.5.2","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":"^22.0.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.3_1591259735596_0.0978359106366824","host":"s3://npm-registry-packages"},"_id":"libp2p-floodsub@0.21.3","version":"0.21.3"}