This package provides a minimal IPFS client as a NestJS Module.
  • TypeScript 100%
Find a file
2025-09-24 21:00:48 +01:00
.github/workflows bump dependencies; added github ci automation 2025-09-24 21:00:48 +01:00
src replace @golevelup/nestjs-modules with build-in approach; bump dependencies 2025-03-15 16:53:09 +00:00
test replace @golevelup/nestjs-modules with build-in approach; bump dependencies 2025-03-15 16:53:09 +00:00
.eslintrc.js initial commit 2022-10-25 16:20:37 +01:00
.gitignore bump dependencies; added github ci automation 2025-09-24 21:00:48 +01:00
.prettierrc initial commit 2022-10-25 16:20:37 +01:00
CHANGELOG.md bump dependencies; added github ci automation 2025-09-24 21:00:48 +01:00
docker-compose.yml replace @golevelup/nestjs-modules with build-in approach; bump dependencies 2025-03-15 16:53:09 +00:00
package.json bump dependencies; added github ci automation 2025-09-24 21:00:48 +01:00
pnpm-lock.yaml bump dependencies; added github ci automation 2025-09-24 21:00:48 +01:00
README.md bump dependencies; added github ci automation 2025-09-24 21:00:48 +01:00
test.txt drop kubo-rpc-client; implement some endpoints by hand 2024-02-05 16:31:51 +00:00
tsconfig.build.json initial commit 2022-10-25 16:20:37 +01:00
tsconfig.json initial commit 2022-10-25 16:20:37 +01:00

IPFS HTTP module for Nest framework (NestJS)

This package provides a IPFS client as a NestJS Module.

Because the previous IPFS HTTP module has been depreciated, and the replacement kubo-rpc-client is utter madness to work with in CommonJS (kubo-rpc-client is a ESM library, which relies on ipfs-utils which is a CommonJS library), I decided to manually implement the important endpoints.

Here's what's supported:

  • add
  • get
  • cat
  • stats/dht

Installation

  • v0.2.0 is using NestJS 9 for legacy reasons.
pnpm install nestjs-ipfs-http

Usage

This module expects a running IPFS daemon.

ipfs daemon

Import

@Module({
    imports: [
        IpfsHttpModule.registerAsync({
            useFactory: () => {
                return {
                    client: {
                        host: '127.0.0.1',
                        port: 5001,
                    },
                }
            },
        }),
    ],
})
export class AppModule {}

Use

const isOnline = await ipfsHttpService.client.isOnline()
console.log(isOnline) // true

Refer to test/e2e/ipfs.spec.ts for more examples.

Test

pnpm run test