An open API service indexing awesome lists of open source software.

https://github.com/mfcodeworks/nestjs-ipfs

A module for utilizing IPFS p2p filesystem with NestJS
https://github.com/mfcodeworks/nestjs-ipfs

Last synced: 8 months ago
JSON representation

A module for utilizing IPFS p2p filesystem with NestJS

Awesome Lists containing this project

README

          


Nest Logo

A Module for Utilizing IPFS P2P File System with NestJS


License
npm version
Built with NestJS

## Description

[IPFS](https://github.com/ipfs/js-ipfs) implementation module for [NestJS](https://github.com/nestjs/nest)

## Installation

```bash
npm i @mfsoftworks/nestjs-ipfs
```

## Quick Start

Import the IPFS module

```typescript
import { IpfsModule } from '@mfsoftworks/nestjs-ipfs';
```

IPFS module supports registering using defaults, or a static object

```typescript
@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`

```typescript
@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.

```typescript
@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](https://github.com/ipfs/js-ipfs), any use of the node will need to be done by your business code.

Future usage can be [suggested](http://github.com/mfsoftworks/nestjs-ipfs/issues) 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](https://docs.nestjs.com/support).

## Stay in touch

- Author - [MF Softworks](https://github.com/mfsoftworks)
- Twitter - [@mfsoftworks](https://twitter.com/mfsoftworks)

## License

@mfsoftworks/nestjs-ipfs is [MIT licensed](LICENSE).