@helia/libp2p 2.1.4-d4962087 → 2.1.5-05d3e4cc
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 +8 -5
- package/dist/index.min.js +49 -49
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.d.ts +13 -31
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -110
- package/dist/src/index.js.map +1 -1
- package/dist/src/light.d.ts +65 -0
- package/dist/src/light.d.ts.map +1 -0
- package/dist/src/light.js +142 -0
- package/dist/src/light.js.map +1 -0
- package/dist/src/routing.d.ts +29 -0
- package/dist/src/routing.d.ts.map +1 -1
- package/dist/src/routing.js +29 -0
- package/dist/src/routing.js.map +1 -1
- package/dist/src/utils/libp2p-defaults.browser.d.ts +1 -1
- package/dist/src/utils/libp2p-defaults.d.ts +1 -1
- package/package.json +8 -3
- package/src/index.ts +14 -151
- package/src/light.ts +188 -0
- package/src/routing.ts +29 -0
- package/src/utils/libp2p-defaults.browser.ts +1 -1
- package/src/utils/libp2p-defaults.ts +1 -1
package/README.md
CHANGED
|
@@ -47,15 +47,18 @@ console.info(node.libp2p.peerId) // 12D3Koo...
|
|
|
47
47
|
|
|
48
48
|
By default `withLibp2p` configures a libp2p node for the current environment.
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
Each option passed replaces the default for that key. Pass `config: 'merge'`
|
|
51
|
+
to merge the options into the default config instead.
|
|
51
52
|
|
|
52
|
-
For full control over your node (and the bundle size), use `withLibp2pLight
|
|
53
|
+
For full control over your node (and the bundle size), use `withLibp2pLight`
|
|
54
|
+
from `@helia/libp2p/light`. That entry point does not load the default
|
|
55
|
+
config or any of its dependencies:
|
|
53
56
|
|
|
54
57
|
```ts
|
|
55
|
-
import {
|
|
56
|
-
import { withLibp2pLight } from '@helia/libp2p'
|
|
58
|
+
import { createHeliaLight } from 'helia/light'
|
|
59
|
+
import { withLibp2pLight } from '@helia/libp2p/light'
|
|
57
60
|
|
|
58
|
-
const node = await withLibp2pLight(
|
|
61
|
+
const node = await withLibp2pLight(createHeliaLight(), {
|
|
59
62
|
//... libp2p config here
|
|
60
63
|
}).start()
|
|
61
64
|
|