{"bugs":{"url":"https://github.com/ChainSafe/gossipsub-js/issues"},"dist":{"shasum":"b5e2fd6ab91667b82a02fe1df8f44904c7daa7f4","tarball":"https://registry.npmjs.org/libp2p-gossipsub/-/libp2p-gossipsub-0.2.0.tgz","fileCount":17,"integrity":"sha512-u5Sd3KjZzwb1uknevDvAzCVrEA6YOq1vU8DPo5V1+jtwlT8CgpXDLn2we2MFNFZldIQFucBfPRRRUSa24l90gg==","signatures":[{"sig":"MEYCIQCebuAG8+e7ix5ZyTHT55SzCsQ57pMq/TA4zbX/hdmL/QIhAP+MS25m/uPHZthChowZz2hMxCoQhpEQpDa1Y9D2k6LR","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7100418,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd5XZXCRA9TVsSAnZWagAApj4P/0YdWJoVVaJW+KTSpnfG\nYrNk8hdV+A+DcfoiPGYzOAapR2QsQR6+Z3F/1itngGLvP1etWMcTGY06aT47\nuLadeUFKp5mTrVqFuIYu3MZTSAiLJffdiceApGrpSaeAML/bwEo+9rwSnGPQ\nhBcjC5SJrJbXZ1MwLgJuo8FC+GLePs1kd3adl/rrolIntNSfABkjLaDaZoz8\nLUWF0jb7x6SfpRxpvTVfeOpW9F5Oxd56GQF9ooTPSorhOE36yw61GYehx+h2\nhAtJ7zozqfUXaI7+awZ0VvFZaoM49HyIrYPOqBReo8FUKfT0beSr6m7a169c\nSxYF8SvPilHAXpzfvBQHgg5cSovX0eGOmvIDnKGO6jRXTR2u8GJ7cl5wn2BX\nglmLE+HAfuKUeP1enZZIfYxKBpS3qvYU/KWbShEqROQAEM6kaqOqvkQOAN33\nue0uTK2bjghuRmT4Qc9LyZ1HPYQ+A5ILl8y5ZTiROxN7g6SayzVWWjyQ7/TL\nMENltoBSQjJRda3Q9WCJRIBAliWoygxo+TKEKka0rlz2RGbhZ5vlvoCqxGms\nxUUU7Ofmcp/yNmp18434ubf8p8K4x5uBMoRgRs9LrjlR93cdI87zAc9FsVnu\nNrsXtFh8tgePfJWyiT8KDMispMGsZ0im/oPmS4Dyq7tnil/eYVxKC9NWnUH/\nPlUs\r\n=8mv/\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.js","name":"libp2p-gossipsub","author":{"name":"Cayman Nava"},"readme":"js-libp2p-gossipsub\n==================\n\n[![](https://img.shields.io/badge/made%20by-ChainSafe-blue.svg?style=flat-square)](https://chainsafe.io/)\n[![Travis CI](https://flat.badgen.net/travis/ipfs/aegir)](https://travis-ci.com/ipfs/aegir)\n\n## Lead Maintainer\n\n[Cayman Nava](https://github.com/wemeetagain)\n\n## Table of Contents\n\n* [Specs](#specs)\n* [Install](#Install)\n* [Usage](#Usage)\n* [API](#API)\n* [Contribute](#Contribute)\n* [License](#License)\n\n## Specs\nGossipsub is an implementation of pubsub based on meshsub and floodsub. You can read the specification [here](https://github.com/libp2p/specs/tree/master/pubsub/gossipsub).\n\n## Install\n\n`npm install libp2p-gossipsub`\n\n## Usage\n\n```javascript\nconst Gossipsub = require('libp2p-gossipsub')\n\nconst registrar = {\n  handle: (multicodecs, handle) => {\n    // register multicodec to libp2p\n    // handle function is called everytime a remote peer opens a stream to the peer.\n  },\n  register: (multicodecs, handlers) => {\n    // handlers will be used to notify pubsub of peer connection establishment or closing\n  },\n  unregister: (id) => {\n\n  }\n}\n\nconst gsub = new Gossipsub(peerInfo, registrar, options)\n\nawait gsub.start()\n\ngsub.on('fruit', (data) => {\n  console.log(data)\n})\ngsub.subscribe('fruit')\n\ngsub.publish('fruit', new Buffer('banana'))\n```\n\n## API\n\n### Create a gossipsub implementation\n\n```js\nconst options = {…}\nconst gossipsub = new Gossipsub(peerInfo, registrar, options)\n```\n\nOptions is an optional object with the following key-value pairs:\n\n* **`fallbackToFloodsub`**: boolean identifying whether the node should fallback to the floodsub protocol, if another connecting peer does not support gossipsub (defaults to **true**).\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## Contribute\n\nThis module is actively under development. Please check out the issues and submit PRs!\n\n## License\n\nMIT © ChainSafe Systems\n","gitHead":"d54e65570654ce79405db8cbb37768078d3a86d2","license":"Apache2.0","scripts":{"lint":"aegir lint","test":"aegir test","build":"aegir build","release":"aegir release","test:node":"aegir test --target node","test:browser":"aegir test --target browser"},"_npmUser":{"name":"wemeetagain","email":"caymannava@gmail.com"},"homepage":"https://github.com/ChainSafe/gossipsub-js#readme","keywords":["gossipsub"],"pre-push":["lint"],"repository":{"url":"git+https://github.com/ChainSafe/gossipsub-js.git","type":"git"},"_npmVersion":"6.11.3","description":"A javascript implementation of gossipsub","directories":{},"maintainers":[{"name":"gregthegreek","email":"gregorymarkou@gmail.com"},{"name":"mpetrunic","email":"marin@nodefactory.io"},{"name":"vascosantos","email":"vasco.santos@moxy.studio"},{"name":"wemeetagain","email":"caymannava@gmail.com"}],"_nodeVersion":"12.11.1","contributors":[{"name":"Cayman","email":"caymannava@gmail.com"},{"name":"ChainSafe","email":"aidan@chainsafe.io"},{"name":"ChainSafe","email":"superadmin@chainsafe.io"},{"name":"Mikerah","email":"mikerahqc@protonmail.com"},{"name":"Mikerah","email":"mikerah14@gmail.com"},{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},{"name":"Vasco Santos","email":"vasco.santos@ua.pt"}],"dependencies":{"debug":"^4.1.1","p-map":"^3.0.0","it-pipe":"^1.0.1","peer-id":"~0.13.3","protons":"^1.0.1","err-code":"^2.0.0","peer-info":"~0.17.0","time-cache":"^0.3.0","libp2p-pubsub":"~0.4.0","libp2p-floodsub":"^0.19.0","it-length-prefixed":"^2.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","aegir":"^20.4.1","mocha":"^6.2.1","sinon":"^7.5.0","lodash":"^4.17.15","it-pair":"^1.0.0","p-times":"^2.1.0","benchmark":"^2.1.4","chai-spies":"^1.0.0","dirty-chai":"^2.0.1","@types/chai":"^4.2.3","detect-node":"^2.0.4","@types/mocha":"^5.2.7","promisify-es6":"^1.0.3"},"_npmOperationalInternal":{"tmp":"tmp/libp2p-gossipsub_0.2.0_1575319127012_0.12522101372888628","host":"s3://npm-registry-packages"},"_id":"libp2p-gossipsub@0.2.0","version":"0.2.0"}