Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iagocalazans/nestjs-google-cloud-storage
Google Cloud Storage as a very simple Module for NestJS framework
https://github.com/iagocalazans/nestjs-google-cloud-storage
bucket google-cloud nestjs storage
Last synced: about 1 month ago
JSON representation
Google Cloud Storage as a very simple Module for NestJS framework
- Host: GitHub
- URL: https://github.com/iagocalazans/nestjs-google-cloud-storage
- Owner: iagocalazans
- License: mit
- Created: 2023-05-04T23:34:49.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-01-11T23:06:34.000Z (about 1 year ago)
- Last Synced: 2024-12-07T23:33:21.462Z (about 2 months ago)
- Topics: bucket, google-cloud, nestjs, storage
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/nestjs-google-cloud-storage
- Size: 122 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nestjs-google-cloud-storage
Google Cloud Storage as a very simple Module for NestJS framework
## Installation
```bash
yarn add nestjs-google-cloud-storage
``````bash
npm install --save nestjs-google-cloud-storage
```## Usage
You can load it as a global module and then just inject it normaly.
```ts
import { StorageModule } from 'nestjs-google-cloud-storage';@Module({
imports: [
StorageModule.forRoot({
bucket: 'your-bucket-name', // This is optional
isGlobal: true,
})
],
controllers: [AppController],
providers: [AppService],
})
export class AppModule {}
``````ts
import { StorageService } from 'nestjs-google-cloud-storage';@Injectable()
export class CustomService {
constructor(
private readonly storageService: StorageService,
) {}create() {
const writableFile = this.storageService.createFileStream(
`filename.wav`,
{ contentType: 'audio/x-wav' },
);
}
}```