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
- Host: GitHub
- URL: https://github.com/mfcodeworks/nestjs-ipfs
- Owner: mfcodeworks
- Created: 2020-03-14T07:03:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T03:12:35.000Z (about 3 years ago)
- Last Synced: 2025-04-12T02:25:54.155Z (about 1 year ago)
- Language: TypeScript
- Size: 1.04 MB
- Stars: 7
- Watchers: 1
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A Module for Utilizing IPFS P2P File System 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).