# peer-dns-client

> A small client to connect to a Peer DNS Server

Latest version **1.0.0** (published 2023-11-20) · ISC license · 0 weekly downloads

## Install

```sh
npm install peer-dns-client
pnpm add peer-dns-client
yarn add peer-dns-client
bun add peer-dns-client
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-11-20 |
| First published | 2023-11-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 8.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | XutyXD |
| Maintainers | xutyxd |
| Keywords | typescript, hybrid, mjs, cjs, peer, dns, client, wrtc, webrtc, wrtc, signal, signaling, dns |

## Links

- npm: https://www.npmjs.com/package/peer-dns-client
- Repository: https://github.com/xutyxd/peer-dns-client
- Homepage: https://github.com/xutyxd/ts-boilerplate#readme
- Issues: https://github.com/xutyxd/ts-boilerplate/issues
- npm.io page: https://npm.io/package/peer-dns-client

## Dependencies (2)

- [rxjs](https://npm.io/package/rxjs.md) ^7.8.1
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^4.7.2

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-11-20

## README

# Peer DNS Client ![NPM Downloads](https://img.shields.io/npm/dw/peer-dns-client)
A small client to connect to a [Peer DNS Server](https://github.com/xutyxd/peer-dns)

## **Installation**
``` bash
npm install peer-dns-client
```

## **Description**
This client implements events of the Peer DNS Server to always stay aligned with server package updates

## **Events**

- **Link**: An event triggered when a new peer connect to a domain that you are listening.
It`s emits an object param with two properties: 
   - **id**: Identifier of external connection
   - **offer**: Optional parameter of type [RTCSessionDescription](https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription)
- **Candidates**: An event triggered when a peer with offer exchanged share it's candidates
It`s emits an object param with two properties:
  - **id**: Identifier of external connection
  - **candidates**: An array of [RTCIceCandidate](https://developer.mozilla.org/en-US/docs/Web/API/RTCIceCandidate)

## **Methods**

- **Query**: Need only a parameter indicating a domain to join a listen for new connections

- **send.link**: Used to response a link event with received id and optional offer

- **send.candidates**: Used to share candidates with an id indicating the other peer and an array of candidates

- **exit**: Used to stop listening connections in a domain

- **close**: Used to close connection with Peer DNS Server

---
_Source: https://npm.io/package/peer-dns-client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
