🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

@crossbell/ipfs-fetch

Package Overview
Dependencies
Maintainers
2
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@crossbell/ipfs-fetch

<a href="https:

0.0.21
latest
Source
npm
Version published
Weekly downloads
119
-23.72%
Maintainers
2
Weekly downloads
 
Created
Source

@crossbell/ipfs-fetch

GitHub license NPM version Bundle size

⚡ 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,
})

FAQs

Package last updated on 01 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts