0.0.21 • Published 6 months ago
@crossbell/ipfs-fetch v0.0.21
@crossbell/ipfs-fetch
⚡ Fetch IPFS contents through the fastest gateway by sending requests to multiple gateways simultaneously. Try on CodeSandbox.
Installation
Using yarn:
yarn add @crossbell/ipfs-fetch
Or via npm:
npm install @crossbell/ipfs-fetch --save
Or via pnpm:
pnpm add @crossbell/ipfs-fetch
Examples
Basic fetch
import { ipfsFetch } from '@crossbell/ipfs-fetch'
ipfsFetch('ipfs://bafkreic5k3zvarbsondfrowy7kpbj6xo7cj25hobksgileqbbupjvvmkoq')
Custom gateways
import { ipfsFetch, IpfsGatewayTemplate } from '@crossbell/ipfs-fetch'
// Default gateways: https://github.com/Crossbell-Box/crossbell-ipfs-utils/blob/main/packages/ipfs-fetch/src/constant.ts
const gateways: IpfsGatewayTemplate[] = [
'https://{cid}.ipfs.cf-ipfs.com/{pathToResource}',
'https://ipfs.io/ipfs/{cid}{pathToResource}',
]
ipfsFetch('ipfs://bafkreic5k3zvarbsondfrowy7kpbj6xo7cj25hobksgileqbbupjvvmkoq', {
gateways,
})
0.0.20
6 months ago
0.0.21
6 months ago
0.0.19
1 year ago
0.0.16
1 year ago
0.0.17
1 year ago
0.0.18
1 year ago
0.0.15
2 years ago
0.0.14
2 years ago
0.0.13
2 years ago
0.0.12
2 years ago
0.0.11
2 years ago
0.0.10
2 years ago
0.0.9
2 years ago
0.0.8
2 years ago
0.0.7
2 years ago
0.0.6
2 years ago
0.0.5
2 years ago
0.0.4
2 years ago
0.0.3
2 years ago
0.0.2
2 years ago
0.0.1
2 years ago