This package provides a minimal IPFS client for CommonJS
- TypeScript 100%
| src | ||
| test | ||
| .eslintrc.js | ||
| .gitignore | ||
| .prettierrc | ||
| CHANGELOG.md | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| test.txt | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
IPFS HTTP Client
This package provides a minimal IPFS client.
Here's what's supported:
- add
- get
- cat
- stats/dht
In theory it should work both on Node.js and in the browser.
Installation
pnpm install ipfs-http-client-minimal
Usage
This module expects a running IPFS daemon.
ipfs daemon
Use
const isOnline = await client.isOnline()
console.log(isOnline) // true
Upload and download:
const up = await client.add(JSON.stringify({ id: 'abc' }))
const down = await client.cat({ arg: up.Hash })
expect(down).toStrictEqual({
id: 'abc',
})
Test
pnpm run test