{"name":"bonjour-service","version":"1.0.12","description":"A Bonjour/Zeroconf implementation in TypeScript","main":"./dist/index.js","dependencies":{"array-flatten":"^2.1.2","dns-equal":"^1.0.0","fast-deep-equal":"^3.1.3","multicast-dns":"^7.2.4"},"devDependencies":{"@types/node":"^14.14.35","@typescript-eslint/eslint-plugin":"^4.19.0","@typescript-eslint/parser":"^4.19.0","after-all":"^2.0.2","eslint":"^8.13.0","standard":"^17.0.0","tape":"^5.2.2","ts-node-dev":"^1.1.8","typescript":"^4.4.4"},"scripts":{"test":"standard --fix && tape test/*.js","build":"tsc --removeComments true","dev":"ts-node-dev --respawn --transpile-only ./src/index.ts","example:simple":"node examples/simple"},"repository":{"type":"git","url":"git+https://github.com/onlxltd/bonjour-service.git"},"keywords":["bonjour","zeroconf","zero","configuration","mdns","dns","service","discovery","multicast","broadcast","dns-sd"],"author":{"name":"ON LX Lited","email":"team@onlx.ltd","url":"https://labs.onlx.ltd"},"license":"MIT","bugs":{"url":"https://github.com/onlxltd/bonjour-service/issues"},"homepage":"https://github.com/onlxltd/bonjour-service","gitHead":"6751d04609b8fbc88258a841d4d9504c3e915924","_id":"bonjour-service@1.0.12","_nodeVersion":"14.19.1","_npmVersion":"6.14.16","dist":{"integrity":"sha512-pMmguXYCu63Ug37DluMKEHdxc+aaIf/ay4YbF8Gxtba+9d3u+rmEWy61VK3Z3hp8Rskok3BunHYnG0dUHAsblw==","shasum":"28fbd4683f5f2e36feedb833e24ba661cac960c3","tarball":"http://registry-npm.ywwl.com/bonjour-service/download/bonjour-service-1.0.12.tgz","fileCount":30,"unpackedSize":62932,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFleipSHzz5JiXEJtehN8xpytVTVE+w/Nwsklmvsc7l3AiBWEY/jR+0n7BBDPVLGoM/BmUDzA2ahWHQAzlUytJWZFw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiYm5RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUzw//faetPPMYhzJkwt9qkYzVIOopIooSyM8QhNyyY49EnQweKftS\r\ng68Z/lAC5/DlQ7+Iy1sRevtuUUUWXoyPN1l+bNpJLeH6pxTSKiQdxoNMF+gb\r\nziOdTyB0M44xZt0VsDb2o0bEupPD6lA9ATpaVkrGwhiTqR8PacLvFc9rjG/M\r\nsbQM4TjDXiKDWInbL3c9Tz9RwFZPpew53wgg9YC8B+DdSTOzogWQ6kdCOi8w\r\nTtprJrF0gkUuVZrtahYOumJZN5YxW7YMzx1iiuDEpgd4Lskazh7XO8V5qgTS\r\nivINJ2XSFDyUGgTySNgwL2fTrEfUH2EEOvqXk7F7QevcIGmw4wGBWUqIDhNG\r\nWmK8VlWUBIioXrYZZ5sMxJ333uS/KKICBu7uWISmarDOC4QcjW9mH/I2fsgW\r\nzj1SfmVhRRfVlKfebjWB++3c3rPM1eoBJPNFMroA3O+WPsW+QffCh9N/25u5\r\ndgxDlgGdxOfrd5zMtUQt5tVKBlsunimmjVgkBSb6r6XvYdCl60OrAmlA2iOj\r\n2RnvJ/FJjYEZxEoKVKRrL/+ctBr0rVTuX7dj11RSsyeP6uxSCAmuCjuqMAcQ\r\n/DFObLPYPKg0RYqqKJb0PdDLPyScbAmGvDjzx5xMLXXGZVRhM8ksFfNL3jUE\r\nd+wUpXZYvFHud+pWSXJzQkFBeiOxBMxCSH8=\r\n=qAhH\r\n-----END PGP SIGNATURE-----\r\n","size":17210,"noattachment":false,"key":"/bonjour-service/-/bonjour-service-1.0.12.tgz"},"_npmUser":{"name":"mdidon","email":"dev@onlx.ltd"},"directories":{},"maintainers":[{"name":"mdidon","email":"dev@onlx.ltd"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bonjour-service_1.0.12_1650617937643_0.5546950064898577"},"_hasShrinkwrap":false,"readme":"# bonjour-service\n\n![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/onlxltd/bonjour-service/publish-release.yml?style=flat-square) ![npm bundle size](https://img.shields.io/bundlephobia/min/bonjour-service?style=flat-square) ![GitHub Release Date](https://img.shields.io/github/release-date/onlxltd/bonjour-service?style=flat-square) ![npm](https://img.shields.io/npm/dw/bonjour-service?color=%23888&style=flat-square) ![GitHub](https://img.shields.io/github/license/onlxltd/bonjour-service?style=flat-square) [![DeepScan grade](https://deepscan.io/api/teams/13435/projects/16430/branches/352351/badge/grade.svg?style=flat-square)](https://deepscan.io/dashboard#view=project&tid=13435&pid=16430&bid=352351)\n\nA Bonjour/Zeroconf protocol implementation in TypeScript. Publish\nservices on the local network or discover existing services using\nmulticast DNS.\n\nThis is a rewrite of the project Bonjour (https://github.com/watson/bonjour) into modern TypeScript.\n\nbonjour-service is supported by [ON LX Limited](https://onlx.ltd/?src=bonjour-service). Check out our projects such as [Ctrl Suite](https://onlx.ltd/ctrl-suite?src=bonjour-service) and [Ctrl for iPad](https://onlx.ltd/ctrl-for-ipad?src=bonjour-service).\n\n\n\n## Installation\nAdd to your project dependencies using Yarn or NPM.\n\n#### Install with Yarn\n```\nyarn add bonjour-service\n```\n#### Install with NPM\n```\nnpm install bonjour-service\n```\n\n## Usage\n\n```js\nimport Bonjour from 'bonjour-service'\n\nconst instance = new Bonjour()\n\n// advertise an HTTP server on port 3000\ninstance.publish({ name: 'My Web Server', type: 'http', port: 3000 })\n\n// browse for all http services\ninstance.find({ type: 'http' }, function (service) {\n  console.log('Found an HTTP server:', service)\n})\n```\n\n## API\n\n### Initializing\n\n```js\nvar instance = new Bonjour({ options }, errorCallback)\n```\n\nThe `options` are optional and will be used when initializing the\nunderlying multicast-dns server. For details see [the multicast-dns\ndocumentation](https://github.com/mafintosh/multicast-dns#mdns--multicastdnsoptions).\n\n`errorCallback` is an optional callback used to gracefully handle errors that would otherwise\ncrash the process. While not being strictly required, providing this is highly recommended\n\n### Publishing\n\n#### `var service = bonjour.publish(options)`\n\nPublishes a new service.\n\nOptions are:\n\n- `name` (string)\n- `host` (string, optional) - defaults to local hostname\n- `port` (number)\n- `type` (string)\n- `subtypes` (array of strings, optional)\n- `protocol` (string, optional) - `udp` or `tcp` (default)\n- `txt` (object, optional) - a key/value object to broadcast as the TXT\n  record\n- `disableIPv6` (boolean, optional) disble IPv6 addresses\n\nIANA maintains a [list of official service types and port\nnumbers](http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml).\n\n#### `bonjour.unpublishAll([callback])`\n\nUnpublish all services. The optional `callback` will be called when the\nservices have been unpublished.\n\n#### `bonjour.destroy()`\n\nDestroy the mdns instance. Closes the udp socket.\n\n### Browser\n\n#### `var browser = bonjour.find(options[, onup])`\n\nListen for services advertised on the network. An optional callback can\nbe provided as the 2nd argument and will be added as an event listener\nfor the `up` event.\n\nOptions (all optional):\n\n- `type` (string)\n- `subtypes` (array of strings)\n- `protocol` (string) - defaults to `tcp`\n- `txt` (object) - passed into [dns-txt\n  module](https://github.com/watson/dns-txt) contructor. Set to `{\n  binary: true }` if you want to keep the TXT records in binary\n\n#### `var browser = bonjour.findOne(options[, callback])`\n\nListen for and call the `callback` with the first instance of a service\nmatching the `options`. If no `callback` is given, it's expected that\nyou listen for the `up` event. The returned `browser` will automatically\nstop it self after the first matching service.\n\nOptions are the same as given in the `browser.find` function.\n\n#### `Event: up`\n\nEmitted every time a new service is found that matches the browser.\n\n#### `Event: down`\n\nEmitted every time an existing service emmits a goodbye message.\n\n#### `Event: txt-update`\n\nEmitted every time an existing service does a new announcement with an updated TXT record.\n\n#### `browser.services()`\n\nAn array of services known by the browser to be online.\n\n#### `browser.start()`\n\nStart looking for matching services.\n\n#### `browser.stop()`\n\nStop looking for matching services.\n\n#### `browser.update()`\n\nBroadcast the query again.\n\n### Service\n\n#### `Event: up`\n\nEmitted when the service is up.\n\n#### `Event: error`\n\nEmitted if an error occurrs while publishing the service.\n\n#### `service.stop([callback])`\n\nUnpublish the service. The optional `callback` will be called when the\nservice have been unpublished.\n\n#### `service.start()`\n\nPublish the service.\n\n#### `service.name`\n\nThe name of the service, e.g. `Apple TV`.\n\n#### `service.type`\n\nThe type of the service, e.g. `http`.\n\n#### `service.subtypes`\n\nAn array of subtypes. Note that this property might be `null`.\n\n#### `service.protocol`\n\nThe protocol used by the service, e.g. `tcp`.\n\n#### `service.host`\n\nThe hostname or ip address where the service resides.\n\n#### `service.port`\n\nThe port on which the service listens, e.g. `5000`.\n\n#### `service.fqdn`\n\nThe fully qualified domain name of the service. E.g. if given the name\n`Foo Bar`, the type `http` and the protocol `tcp`, the `service.fqdn`\nproperty will be `Foo Bar._http._tcp.local`.\n\n#### `service.txt`\n\nThe TXT record advertised by the service (a key/value object). Note that\nthis property might be `null`.\n\n#### `service.published`\n\nA boolean indicating if the service is currently published.\n\n## License\n\nMIT\n","publish_time":1650617937811,"_cnpm_publish_time":1650617937811,"dist-tags":{"latest":"1.4.4"}}