1.0.2 • Published 5 years ago

@mfsoftworks/nestjs-ipfs v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

Description

IPFS implementation module for NestJS

Installation

npm i @mfsoftworks/nestjs-ipfs

Quick Start

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 {}

Wait for Node

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 {}

Usage

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.

Support

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.

Stay in touch

License

@mfsoftworks/nestjs-ipfs is MIT licensed.

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago