You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor: export types and utilities statically (ipfs#951)
Allows users to access these additional types and utilities without having to create an instance of the client first.
resolvesipfs#902
BREAKING CHANGE: `ipfs.util.isIPFS` has moved to a static export and should be accessed via `const { isIPFS } = require('ipfs-http-client')`.
The modules available under `ipfs.types.*` have also become static exports.
`ipfs.util.crypto` has been removed as it is not a dependency of `ipfs-http-client` so reduces the bundle size. If you need to use libp2p crypto primitives then please see the [js-libp2p-crypto](https://github.com/libp2p/js-libp2p-crypto) project for info on how to use it in your project.
Finally `ipfs.util.getEndpointConfig` is now a direct instance method, `ipfs.getEndpointConfig`
License: MIT
Signed-off-by: Alan Shaw <[email protected]>
Call this on your client instance to return an object containing the `host`, `port`, `protocol` and `api-path`.
362
356
363
-
#### Extra (util) functions
357
+
#### Static types and utils
364
358
365
-
Adding to the methods defined by [`interface-ipfs-core`](https://github.com/ipfs/interface-ipfs-core), `js-ipfs-http-client`exposes a set of extra utility methods. These utility functions are scoped behind the `ipfs.util`.
359
+
Aside from the default export, `ipfs-http-client`exports various types and utilities that are included in the bundle:
366
360
367
-
Complete documentation for these methods is coming with: https://github.com/ipfs/js-ipfs-http-client/pull/305
0 commit comments