IPFS implementation module for NestJS
npm i @mfsoftworks/nestjs-ipfs
Import the IPFS module
import { IpfsModule } from '@mfsoftworks/nestjs-ipfs';
IPFS module supports registering using defaults, or a static object
@Module({
imports: [IpfsModule.register()],
providers: [AppService],
})
export class AppModule {}
IPFS module supports async registration with useClass
, useExisting
, including a createIPFSOptions
function; or a custom useFactory
@Module({
imports: [IpfsModule.registerAsync({
useClass: ConfigService
})],
providers: [AppService],
})
export class AppModule {}
IPFS module supports immediate start by default, as well as an optional waitForNode
passed as a second parameter to wait for IPFS node initialisation before bootstrap proceeds.
@Module({
imports: [IpfsModule.register({}, true)],
providers: [AppService],
})
export class AppModule {}
getNode()
- Call getNode
to return the IPFS node. If it's been called previously, or waitForNode
is true it will return the cached IPFS node object.
Currently this module is a basic Nest implementation of js-ipfs, any use of the node will need to be done by your business code.
Future usage can be suggested or contribute your own pull request to extend the functionality of this module further.
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - MF Softworks
- Twitter - @mfsoftworks
@mfsoftworks/nestjs-ipfs is MIT licensed.