js-ipfs-http-client-lite
js-ipfs-http-client-lite copied to clipboard
Benefits and Drawbacks
Some notes hanging around on my desktop:
Benefits
- Tiny bundle size
- Import just the part you want to use:
const add = require('ipfs-http-client-lite/src/add')(); await add(...)
- Uses
window.fetchandnode-fetchunder the hood - Pass a custom
fetchimplementation - Cancelable requests with
AbortSignalfor all requests - Pubsub works in the browser
Drawbacks
- No custom classes returned from API methods
- No
CIDs - No
PeerInfos - No
PeerIds - etc.
- No
- No support for passing CIDs as buffers to API methods
- Not
interface-ipfs-corecompatible- Although a
CoreAdapterexists to allow tests to run
- Although a
- No APIs that return Node.js style streams (big bundle size inflate if include
readable-stream)- Hence, missing:
addReadableStreamcatReadableStream
- That said, APIs can consume Node.js streams because they are async iterable
- Hence, missing:
Eventually:
ipfs-http-client could just export new CoreAdapter(ipfsLiteClient)