This package provides a minimal IPFS client for CommonJS
  • TypeScript 100%
Find a file
2024-02-05 19:29:49 +00:00
src added helper function; cleanup dependencies 2024-02-05 19:29:49 +00:00
test added helper function; cleanup dependencies 2024-02-05 19:29:49 +00:00
.eslintrc.js initial commit 2024-02-05 19:03:06 +00:00
.gitignore initial commit 2024-02-05 19:03:06 +00:00
.prettierrc initial commit 2024-02-05 19:03:06 +00:00
CHANGELOG.md added helper function; cleanup dependencies 2024-02-05 19:29:49 +00:00
package.json added helper function; cleanup dependencies 2024-02-05 19:29:49 +00:00
pnpm-lock.yaml added helper function; cleanup dependencies 2024-02-05 19:29:49 +00:00
README.md initial commit 2024-02-05 19:03:06 +00:00
test.txt initial commit 2024-02-05 19:03:06 +00:00
tsconfig.build.json initial commit 2024-02-05 19:03:06 +00:00
tsconfig.json initial commit 2024-02-05 19:03:06 +00:00

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