{"bugs":{"url":"https://github.com/ChainSafe/gossipsub-js/issues"},"dist":{"shasum":"31e0ea3d85fd07336f7bb947d860f363fa7911a3","tarball":"https://registry.npmjs.org/libp2p-gossipsub/-/libp2p-gossipsub-0.2.2.tgz","fileCount":17,"integrity":"sha512-TFAd6wqtv5aLBdK7oL7cWStZp1D1A8BR07kYwVZsXZwZSt7Sab/YsR+CU/OXkgth5NiBGwFn07+A6kN7Pfijkw==","signatures":[{"sig":"MEUCICc+SPq9Ui4xX1IYHqZwXl6h9sJKP7itEu0tZu5xqH0qAiEAiUrlue5fLaRpP7sj7gZc/77ZFZS3bmk54t6BXw1jdvc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6903042,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeKzxMCRA9TVsSAnZWagAAokEP/12BP9Cy9BrD1Jb/Znpl\nOMMxGp3Ach8kG0len7qBJeKD3mcPR2pmle+fxJjoicZPHuOX0kiAngBlMcLQ\nCa8RC+J58xRSGRJ4tvr5e/KBzxcyqORehe7QDHu1ejsSjOlzyzFJdheCk3ui\n+XstMWHcwNmKdZtRUelo+LlbsP0BnmOyI9JhXZRJn7MnFNTVCT9FlrHHt4Pr\nr8efBwH1083dhtpkuELEhYT/R3F3siT03d+bDIIbGRmyT9MvsdcP0h4+mcHk\nV884P4BG23REWycF0fZMm/QKC7o3bQuwmV7cWfAemdQeXV9xuX17wRAXkJbd\n2xv/V18jmkj9IR7nCi8yzpWc9af/TVp/K3bw4GsuBd7PrqK8LIubIZyuYACm\nhxplbqoU09RUiAQr0SZrjqdskH76SH9wP33LQMH+ezWX8UfT1MlLF9Ql0xtj\nbbq6blT2FoUOnEz/Ynd5oa7lji0lMr7K+YSoLQH/m/aP2+PKDg1N4Tg0qzP4\niM8M2u+2LUgN7fMFqZ31FV31d8CmLGvbOVEz1wRkbtboimzFgVAudnzl0UxG\nbw3BS+f5ubCa1Sffft7puXyYqrdxszDpL2/OsFj+rlez1isxjWjBZcqS94G+\np1J/SiL3vW1eu5N22pqOgpVXhXEexI4I3I204Qs5TcdFCqDhu7Wsb56CPcuY\n6hal\r\n=u+/8\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/ChainSafe/gossipsub-js)](https://travis-ci.com/ChainSafe/gossipsub-js)\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":"67e35c252f45d9105e94a2431c1d6f68ed0f9622","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.12.1","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.13.1","contributors":[{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"Cayman","email":"caymannava@gmail.com"},{"name":"ChainSafe","email":"aidan@chainsafe.io"},{"name":"ChainSafe","email":"superadmin@chainsafe.io"},{"name":"Gregory Markou","email":"16929357+GregTheGreek@users.noreply.github.com"},{"name":"Gregory Markou","email":"gregorymarkou@gmail.com"},{"name":"Jacob Heun","email":"jacobheun@gmail.com"},{"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"},{"name":"achingbrain","email":"alex@achingbrain.net"}],"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.1","libp2p-floodsub":"^0.20.0","it-length-prefixed":"^2.0.0"},"_hasShrinkwrap":false,"leadMaintainer":"Cayman Nava <caymannava@gmail.com>","readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","aegir":"^20.5.0","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","p-wait-for":"^3.1.0","@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.2_1579891787818_0.8785367759171998","host":"s3://npm-registry-packages"},"_id":"libp2p-gossipsub@0.2.2","version":"0.2.2"}