{"bugs":{"url":"https://github.com/libp2p/js-libp2p-mdns/issues"},"dist":{"shasum":"e74cf5f12d0da4bf1c2c562aad24eee548237f10","tarball":"https://registry.npmjs.org/libp2p-mdns/-/libp2p-mdns-0.14.0.tgz","fileCount":10,"integrity":"sha512-0j2SbXMc7VezOEKtQRtcmw7baO0zr4MZIO49saMkeSYFsT/qni4Gz6b1EEUuhFM6sB2fDtZkXym+ic0GbQy8sQ==","signatures":[{"sig":"MEUCIFnNF2YGE1L/S38H611Ai8YTNXzndhJVnz0Ix/ZcbS+ZAiEA8VNe2mevo81rqdbDAzWHIxq31FzlVS8vHfpH0fbbJJ0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":26207,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeoYVUCRA9TVsSAnZWagAAAzAP/jzQH/IGYtTjNR/UzEla\niqpJkYtROmY0E8U1rk3IZVP1qCYHfn9hl8D5B4MWX9jZzP68krLgcjoRhp/z\n4HrVrDOPyniTpIVS+F9Hy7k42OD7qM8zJLQ3MrLvc2ZdIm11TsCV+gjwOANJ\nOJ1pOV8S2xFzFxl4dXSvHErd48Ob7uj/Ce8fQcvdOHGtmmTwVrFxR/dTZ5wE\nM62AuiU1HCzHiQ7x81VrZ2jzCFS/5XAot2FzJYV2UOoCaGDjbO1GPho3OjBR\nP67rEqmW595Il7An3ccUX1U8DlIG2r2Es9qhqVPMlNQynR6yku8gZNL0KAMj\nI2ihz0JBlaDtFeLRLwVsFX5vsNUSa3QLtIu0BBRAq8LfO9U35fxX9lNbha3O\nE+AEpzkRGogO0SIe/FK8G+0NjXRWzzaqWdtAMwLbKWdpdM5qOW+cn6Jp0x+I\nuNcp0nqTwZnAedBnXd59dW7+luf+zRAwrELWZzUcETROIKCKbXU+m5KEah0M\nDX6EEA+whMAUyTwz2sGCJbDG2eCasFlrYxQRIazK60BAB5Wv6Wa1JNKx2MUl\nqXwb1ZSmN7/JVpM+KyFcTFlcyJlvUzdGxkfUIqO3RKxyrKMHpNfwv70mSlt3\neg53X7VrCv6Qfy0haSuHk3ki42gEcNhmNOGZaXT/ui44frUXmxMvbUL0w4GP\nVT7g\r\n=CjtU\r\n-----END PGP SIGNATURE-----\r\n"},"main":"src/index.js","name":"libp2p-mdns","readme":"libp2p-mdns JavaScript implementation\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[![](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-mdns.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-mdns)\n[![](https://img.shields.io/travis/libp2p/js-libp2p-mdns.svg?style=flat-square)](https://travis-ci.com/libp2p/js-libp2p-mdns)\n[![Dependency Status](https://david-dm.org/libp2p/js-libp2p-mdns.svg?style=flat-square)](https://david-dm.org/libp2p/js-libp2p-mdns)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\n> JavaScript libp2p MulticastDNS discovery implementation\n\n## Lead Maintainer\n\n[Jacob Heun](https://github.com/jacobheun)\n\n## Usage\n\n```JavaScript\nconst MDNS = require('libp2p-mdns')\n\nconst mdns = new MDNS(options)\n\nmdns.on('peer', (peerData) => {\n  console.log('Found a peer in the local network', peerData.id.toB58String(), peerData.multiaddrs)\n})\n\n// Broadcast for 20 seconds\nmdns.start()\nsetTimeout(() => mdns.stop(), 20 * 1000)\n```\n\n- options\n  - `peerId` - PeerId to announce\n  - `multiaddrs` - multiaddrs to announce\n  - `broadcast` - (true/false) announce our presence through mDNS, default `false`\n  - `interval` - query interval, default 10 * 1000 (10 seconds)\n  - `serviceTag` - name of the service announce , default 'ipfs.local`\n  - `compat` - enable/disable compatibility with go-libp2p-mdns, default `true`\n\n## MDNS messages\n\nA query is sent to discover the IPFS nodes on the local network\n\n```\n{ type: 'query',\n  questions: [ { name: 'ipfs.local', type: 'PTR' } ]\n}\n```\n\nWhen a query is detected, each IPFS node sends an answer about itself\n\n```\n[ { name: 'ipfs.local',\n    type: 'PTR',\n    class: 'IN',\n    ttl: 120,\n    data: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK.ipfs.local' },\n  { name: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK.ipfs.local',\n    type: 'SRV',\n    class: 'IN',\n    ttl: 120,\n    data:\n     { priority: 10,\n       weight: 1,\n       port: '20002',\n       target: 'LAPTOP-G5LJ7VN9' } },\n  { name: 'QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK.ipfs.local',\n    type: 'TXT',\n    class: 'IN',\n    ttl: 120,\n    data: ['QmNPubsDWATVngE3d5WDSNe7eVrFLuk38qb9t6vdLnu2aK'] },\n  { name: 'LAPTOP-G5LJ7VN9',\n    type: 'A',\n    class: 'IN',\n    ttl: 120,\n    data: '127.0.0.1' },\n  { name: 'LAPTOP-G5LJ7VN9',\n    type: 'AAAA',\n    class: 'IN',\n    ttl: 120,\n    data: '::1' } ]\n```\n","gitHead":"5b46aaa16fa7e419b440730ffdee3a5f6956f1bb","license":"MIT","scripts":{"lint":"aegir lint","test":"aegir test -t node","release":"aegir release -t node --no-build","coverage":"nyc --reporter=lcov --reporter=text npm run test:node","test:node":"aegir test -t node","release-major":"aegir release --type major -t node --no-build","release-minor":"aegir release --type minor -t node --no-build","coverage-publish":"aegir coverage publish"},"_npmUser":{"name":"jacobheun","email":"jacobheun@gmail.com"},"homepage":"https://github.com/libp2p/js-libp2p-mdns","keywords":["IPFS"],"pre-push":["lint"],"repository":{"url":"git+https://github.com/libp2p/js-libp2p-mdns.git","type":"git"},"_npmVersion":"6.14.2","description":"Node.js libp2p mDNS discovery implementation for peer discovery","directories":{},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"_nodeVersion":"12.16.1","contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Jacob Heun","email":"jacobheun@gmail.com"},{"name":"Nuno Nogueira","email":"nunofmn@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"},{"name":"Vasco Santos","email":"vasco.santos@moxy.studio"},{"name":"Alex Potsides","email":"alex@achingbrain.net"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"dirkmc","email":"dirkmdev@gmail.com"},{"name":"emersion","email":"contact@emersion.fr"}],"dependencies":{"debug":"^4.1.1","peer-id":"~0.13.3","multiaddr":"^7.1.0","multicast-dns":"^7.2.0"},"_hasShrinkwrap":false,"leadMaintainer":"Jacob Heun <jacobheun@gmail.com>","readmeFilename":"README.md","devDependencies":{"chai":"^4.2.0","aegir":"^21.0.2","delay":"^4.3.0","p-defer":"^3.0.0","dirty-chai":"^2.0.1","libp2p-interfaces":"^0.3.0"},"_npmOperationalInternal":{"tmp":"tmp/libp2p-mdns_0.14.0_1587643732210_0.7604018115113267","host":"s3://npm-registry-packages"},"_id":"libp2p-mdns@0.14.0","version":"0.14.0"}