{"bugs":{"url":"https://github.com/ChainSafe/gossipsub-js/issues"},"dist":{"shasum":"40de229bdaec960e57bae68a5940584edd68691c","tarball":"https://registry.npmjs.org/libp2p-gossipsub/-/libp2p-gossipsub-0.1.0.tgz","fileCount":17,"integrity":"sha512-WXAoXbgj2HiB8Sgfjmn8iLKds72gzARRq6/ADWUikSX3PBmpdM0uh9Y72UMM5Qr2I2nI8DR+q/59oOLLkKVzQA==","signatures":[{"sig":"MEUCIQCyQoTU6+7i174IZbIq69rq3sOGlOVQHy4FkQCLNXcAXwIgW4q75rzA6UvmNBGJGgJFlXuG96hOCjw2dZe2mBykzTY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7100081,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJd1G+aCRA9TVsSAnZWagAAZz0P/A6eSnlyDCH/ZH+k7C1Q\ns3Wx6oBKYL3tKYbNqgGPCiy0En5VpObQ1qtPU0qyoynH+8bj1V13DRyWE0Xw\n1OhuspiLx+W98bCcjBFfVe+VjpWBvS2lvWypW5dD8kr7FTivD+voPl7IlWHW\nvVQ5KewxD8KG/ZFCzqs6FMiHJoSiUAywCX00pgrCRE/4RdXZCYArk5C/ZXLU\nLYJVWoViWDz41VWUb/X0irsuopZF6qDgUepZUa5IMgLLhQFHYnUSRl0hQWDB\ndT1u4P/5r+WXQRFDh0TBDuRpYwtbZQZ+6roDCtbeexZr7k+o2Mpm3w9JkUkB\nOgUYZVlwnwDre5TWCJZ7WmG70ADVfcke8q918+qO9NbNqKT5EH5pMhAsALsk\nsrPTqCwm5EAqA9s2zcHfn0OpnY8QephrNeZW6XgWRIPifZZiYfcl244HSvMK\nW0z+pMY4o5Lgr1IIC03Z6GKiTT2jz2PDB1zKMfT82MjM1HuhNH8jxeAjey2e\n6W2v93ZfDxJYThqvhQqzQIlMb/w1AwqcsUzf8XJF0wWZJh2RPl0VgGh3nBWS\n1Otr14SRJsGkLJpnLF5u9FJ4yWB4BlhxOflHyZzCPx+A1aPSBPCaozLM8UE1\n2cD5yxmQbIrhW1MFdSEvbfu7YY3Gx2CCyfA9gGEQgQ1wY/jA8fb/+AuM0OVl\nSElu\r\n=jTxA\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":"79934a85fe8f84f4bd907931a0585fd80fad7afe","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.3.1","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.1.0_1574203289793_0.9779809383106539","host":"s3://npm-registry-packages"},"_id":"libp2p-gossipsub@0.1.0","version":"0.1.0"}