2.2.0 • Published 2 years ago

@web3-storage/blob-fetcher v2.2.0

Weekly downloads
-
License
Apache-2.0 OR MIT
Repository
-
Last release
2 years ago

@web3-storage/blob-fetcher

A blob fetcher that batches requests and reads multipart byterange responses.

Install

npm install @web3-storage/blob-fetcher

Usage

Example

import * as SimpleFetcher from '@web3-storage/blob-fetcher/fetcher/simple'
import * as ContentClaimsLocator from '@web3-storage/blob-fetcher/locator/content-claims'
import * as Digest from 'multiformats/hashes/digest'
import { base58btc } from 'multiformats/bases/base58'

const locator = ContentClaimsLocator.create()
const fetcher = SimpleFetcher.create(locator)

const digest = Digest.decode(base58btc.decode('zQmZ3Q2KuYrg3LiizMcArupHjv3dDdn3r4MLPtANTsj3ut5'))
const res = await fetcher.fetch(digest)
if (!res.ok) throw res.error

const bytes = await res.ok.bytes()

Contributing

Feel free to join in. All welcome. Open an issue!

License

Dual-licensed under MIT / Apache 2.0

2.5.0

11 months ago

2.4.4-rc.1

11 months ago

2.4.4-rc.0

11 months ago

2.4.3

1 year ago

2.3.1

1 year ago

2.2.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

1.1.0

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago