@push.rocks/smartdns 7.6.1 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@push.rocks/smartdns',
6
- version: '7.6.1',
6
+ version: '7.8.0',
7
7
  description: 'A robust TypeScript library providing advanced DNS management and resolution capabilities including support for DNSSEC, custom DNS servers, and integration with various DNS providers.'
8
8
  }
package/ts/readme.md ADDED
@@ -0,0 +1,47 @@
1
+ # @push.rocks/smartdns
2
+
3
+ Unified entry point that re-exports both the DNS client and DNS server modules.
4
+
5
+ ## Import
6
+
7
+ ```typescript
8
+ import { dnsClientMod, dnsServerMod } from '@push.rocks/smartdns';
9
+ ```
10
+
11
+ ## Modules
12
+
13
+ | Module | Description |
14
+ |---|---|
15
+ | `dnsClientMod` | DNS resolution — system, UDP, DoH strategies via `Smartdns` class |
16
+ | `dnsServerMod` | Authoritative DNS server — UDP, HTTPS, DNSSEC, ACME via `DnsServer` class |
17
+
18
+ ## Usage
19
+
20
+ ```typescript
21
+ import { dnsClientMod, dnsServerMod } from '@push.rocks/smartdns';
22
+
23
+ // Client
24
+ const client = new dnsClientMod.Smartdns({ strategy: 'prefer-udp' });
25
+ const records = await client.getRecordsA('example.com');
26
+ client.destroy();
27
+
28
+ // Server
29
+ const server = new dnsServerMod.DnsServer({
30
+ udpPort: 5333,
31
+ httpsPort: 8443,
32
+ httpsKey: '...',
33
+ httpsCert: '...',
34
+ dnssecZone: 'example.com',
35
+ });
36
+ server.registerHandler('example.com', ['A'], (q) => ({
37
+ name: q.name, type: 'A', class: 'IN', ttl: 300, data: '93.184.215.14',
38
+ }));
39
+ await server.start();
40
+ ```
41
+
42
+ For direct imports, use the sub-module paths:
43
+
44
+ ```typescript
45
+ import { Smartdns } from '@push.rocks/smartdns/client';
46
+ import { DnsServer } from '@push.rocks/smartdns/server';
47
+ ```