spread-the-word

A Bonjour / Zeroconf implementation in TypeScript

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
spread-the-word
0.9.32 years ago6 years agoMinified + gzip package size for spread-the-word in KB

Readme

spread-the-word
A Bonjour / Zeroconf implementation in TypeScript.
Github Version NPM Version NPM Downloads License CircleCI Spread services across your local network and discover other services

Installation

```sh $ npm i spread-the-word ```

Usage

```js import stw from "spread-the-word"; stw.on("up", (remoteService, response, referrer) => { console.log(${remoteService.name} (type: ${remoteService.type}, port: ${remoteService.port}) is up (from ${referrer.address})); if (remoteService.txt) {
console.log("TXT found:", remoteService.txt);
} }).on("down", (remoteService, response, referrer) => { console.log(${remoteService.name} (type: ${remoteService.type}, port: ${remoteService.port}) is down (from ${referrer.address})); }); stw.listen({ type: "jsremote" }); stw.spread({ type: "jsremote", name: "awesome remote receiver", port: 4444, txt: {
message: "Custom Data"
} }); ```

Features

  • easy service detection & advertisement on your local network
  • TXT record support
- used encoder / decoder
  • no extra native dependencies
  • typescript types included

Documentation

You can find the latest version of documentation hosted here.

Debug

```sh $ DEBUG=SpreadTheWord: npm start ```

License

MIT