@helia/dnslink 1.2.0 → 1.2.1-1361bfa5
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.
- package/README.md +12 -18
- package/dist/index.min.js +1 -4
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +7 -13
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -13
- package/dist/src/index.js.map +1 -1
- package/package.json +10 -25
- package/src/index.ts +7 -13
- package/dist/typedoc-urls.json +0 -22
package/README.md
CHANGED
|
@@ -41,16 +41,14 @@ import { createHelia } from 'helia'
|
|
|
41
41
|
import { dnsLink } from '@helia/dnslink'
|
|
42
42
|
import { dns } from '@multiformats/dns'
|
|
43
43
|
import { dnsOverHttps } from '@multiformats/dns/resolvers'
|
|
44
|
-
import type { DefaultLibp2pServices } from 'helia'
|
|
45
|
-
import type { Libp2p } from '@libp2p/interface'
|
|
46
44
|
|
|
47
|
-
const node = await createHelia
|
|
45
|
+
const node = await createHelia({
|
|
48
46
|
dns: dns({
|
|
49
47
|
resolvers: {
|
|
50
48
|
'.': dnsOverHttps('https://private-dns-server.me/dns-query')
|
|
51
49
|
}
|
|
52
50
|
})
|
|
53
|
-
})
|
|
51
|
+
}).start()
|
|
54
52
|
const name = dnsLink(node)
|
|
55
53
|
|
|
56
54
|
const result = name.resolve('some-domain-with-dnslink-entry.com')
|
|
@@ -71,7 +69,7 @@ Calling `resolve` with the `@helia/dnslink` instance:
|
|
|
71
69
|
import { createHelia } from 'helia'
|
|
72
70
|
import { dnsLink } from '@helia/dnslink'
|
|
73
71
|
|
|
74
|
-
const node = await createHelia()
|
|
72
|
+
const node = await createHelia().start()
|
|
75
73
|
const name = dnsLink(node)
|
|
76
74
|
|
|
77
75
|
const [{ answer }] = await name.resolve('blog.ipfs.tech')
|
|
@@ -93,16 +91,14 @@ import { createHelia } from 'helia'
|
|
|
93
91
|
import { dnsLink } from '@helia/dnslink'
|
|
94
92
|
import { dns } from '@multiformats/dns'
|
|
95
93
|
import { dnsOverHttps } from '@multiformats/dns/resolvers'
|
|
96
|
-
import type { DefaultLibp2pServices } from 'helia'
|
|
97
|
-
import type { Libp2p } from '@libp2p/interface'
|
|
98
94
|
|
|
99
|
-
const node = await createHelia
|
|
95
|
+
const node = await createHelia({
|
|
100
96
|
dns: dns({
|
|
101
97
|
resolvers: {
|
|
102
98
|
'.': dnsOverHttps('https://mozilla.cloudflare-dns.com/dns-query')
|
|
103
99
|
}
|
|
104
100
|
})
|
|
105
|
-
})
|
|
101
|
+
}).start()
|
|
106
102
|
const name = dnsLink(node)
|
|
107
103
|
|
|
108
104
|
const result = await name.resolve('blog.ipfs.tech')
|
|
@@ -118,16 +114,14 @@ import { createHelia } from 'helia'
|
|
|
118
114
|
import { dnsLink } from '@helia/dnslink'
|
|
119
115
|
import { dns } from '@multiformats/dns'
|
|
120
116
|
import { dnsJsonOverHttps } from '@multiformats/dns/resolvers'
|
|
121
|
-
import type { DefaultLibp2pServices } from 'helia'
|
|
122
|
-
import type { Libp2p } from '@libp2p/interface'
|
|
123
117
|
|
|
124
|
-
const node = await createHelia
|
|
118
|
+
const node = await createHelia({
|
|
125
119
|
dns: dns({
|
|
126
120
|
resolvers: {
|
|
127
121
|
'.': dnsJsonOverHttps('https://mozilla.cloudflare-dns.com/dns-query')
|
|
128
122
|
}
|
|
129
123
|
})
|
|
130
|
-
})
|
|
124
|
+
}).start()
|
|
131
125
|
const name = dnsLink(node)
|
|
132
126
|
|
|
133
127
|
const result = await name.resolve('blog.ipfs.tech')
|
|
@@ -141,22 +135,22 @@ $ npm i @helia/dnslink
|
|
|
141
135
|
|
|
142
136
|
## Browser `<script>` tag
|
|
143
137
|
|
|
144
|
-
Loading this module through a script tag will make its exports available as `
|
|
138
|
+
Loading this module through a script tag will make its exports available as `HeliaDnslink` in the global namespace.
|
|
145
139
|
|
|
146
140
|
```html
|
|
147
|
-
<script src="https://unpkg.com/@helia/
|
|
141
|
+
<script src="https://unpkg.com/@helia/dnslink/dist/index.min.js"></script>
|
|
148
142
|
```
|
|
149
143
|
|
|
150
144
|
# API Docs
|
|
151
145
|
|
|
152
|
-
- <https://ipfs.github.io/helia/modules/
|
|
146
|
+
- <https://ipfs.github.io/helia/modules/_helia_dnslink.html>
|
|
153
147
|
|
|
154
148
|
# License
|
|
155
149
|
|
|
156
150
|
Licensed under either of
|
|
157
151
|
|
|
158
|
-
- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/helia/blob/main/packages/
|
|
159
|
-
- MIT ([LICENSE-MIT](https://github.com/ipfs/helia/blob/main/packages/
|
|
152
|
+
- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/helia/blob/main/packages/dnslink/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
|
|
153
|
+
- MIT ([LICENSE-MIT](https://github.com/ipfs/helia/blob/main/packages/dnslink/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
|
|
160
154
|
|
|
161
155
|
# Contribute
|
|
162
156
|
|