A fetch() implementation for the Dat/Hypercore peer-to-peer ecosystem, enabling HTTP-style requests to p2p content via the hyper:// protocol. Current stable version 10.2.0 integrates with hyper-sdk to resolve keys, manage drives, and support GET, PUT, POST, DELETE operations. Supports DNSLink domains, directory listings, ETag-based versioning, and extension messages. Differentiates itself by bringing the familiar Fetch API to decentralized storage, with optional writability and lifecycle hooks for drive management. Release cadence is irregular; breaking changes may occur with hyper-sdk updates.
npm install hypercore-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows creation of a hyper-sdk instance, initializing hypercore-fetch with write support, fetching content via GET, and uploading via PUT.
await makeHyperFetch({...}) or use .then().Use import default or const make = (await import('hypercore-fetch')).default.Create SDK via SDK.create() and pass to makeHyperFetch.
Omit extensionMessages or set to writable value.
Always await response.text() or response.arrayBuffer() after write operations.
Ensure drive is created or resolved via hyper-sdk before fetch.
Use import makeHyperFetch from 'hypercore-fetch' (ESM) or const make = await import('hypercore-fetch').then(m=>m.default).const fetch = await makeHyperFetch({...})Pass an SDK instance created with SDK.create() as { sdk }.