Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ardean/spread-the-word
:loudspeaker: A Bonjour / Zeroconf implementation in TypeScript
https://github.com/ardean/spread-the-word
bonjour bonjour-discovery javascript mdns multicast-dns spread typescript zeroconf
Last synced: 4 days ago
JSON representation
:loudspeaker: A Bonjour / Zeroconf implementation in TypeScript
- Host: GitHub
- URL: https://github.com/ardean/spread-the-word
- Owner: ardean
- License: mit
- Created: 2018-02-14T07:27:03.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-20T14:23:58.000Z (over 1 year ago)
- Last Synced: 2024-11-06T08:43:20.282Z (14 days ago)
- Topics: bonjour, bonjour-discovery, javascript, mdns, multicast-dns, spread, typescript, zeroconf
- Language: TypeScript
- Homepage:
- Size: 1.19 MB
- Stars: 10
- Watchers: 2
- Forks: 4
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# spread-the-word
> A Bonjour / Zeroconf implementation in TypeScript.
[![Github Version](https://img.shields.io/github/release/ardean/spread-the-word.svg)](https://github.com/ardean/spread-the-word)
[![NPM Version](https://img.shields.io/npm/v/spread-the-word.svg)](https://npmjs.org/package/spread-the-word)
[![NPM Downloads](https://img.shields.io/npm/dm/spread-the-word.svg)](https://npmjs.org/package/spread-the-word)
[![License](https://img.shields.io/npm/l/spread-the-word.svg)](LICENSE.md)
[![CircleCI](https://circleci.com/gh/ardean/spread-the-word.svg?style=svg)](https://circleci.com/gh/ardean/spread-the-word)*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](https://tools.ietf.org/html/rfc6763#section-6) record support
- used [encoder / decoder](https://www.npmjs.com/package/dns-txt)
- [subtypes](https://tools.ietf.org/html/rfc6763#section-7.1) support
- auto [probing](https://tools.ietf.org/html/rfc6762#section-8.1) on spread
- no extra native dependencies
- typescript types included## Documentation
You can find the latest version of documentation hosted [here](https://ardean.github.io/spread-the-word/index.html).
## Debug
```sh
$ DEBUG=SpreadTheWord:* npm start
```## License
[MIT](LICENSE.md)