1.0.0 • Published 4 years ago

p2p-fetch v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

p2p-fetch

A fetch interface which supports multiple peer to peer protocols

Usage

npm i --save ipfs p2p-fetch
const makeP2PFetch = require('p2p-fetch')

const fetch = await makeP2PFetch()

const response = await fetch('ipns://ipfs.io/')

console.log(await response.text())

API

For guides on using the Fetch API, look at the docs on Mozilla Developer Nework. For IPFS-specific fetch interfaces, look at js-ipfs-fetch

const fetch = await makeP2PFetch({ipfsOptions})

Initialize the fetch interface. You can optionally pass in some configuration settings for IPFS.