@anchan828/nest-storage-gcs

> TODO: description

Usage no npm install needed!

<script type="module">
  import anchan828NestStorageGcs from 'https://cdn.skypack.dev/@anchan828/nest-storage-gcs';
</script>

README

@anchan828/nest-storage-gcs

Install

npm i @anchan828/nest-storage @anchan828/nest-storage-gcs

Usage

@Module({
  imports: [
    StorageModule.register({
      bucket: "bucket",
      cacheDir: "path/to/cacheDir",
    }),
    GoogleCloudStorageProviderModule.register({
      keyFilename: "path/to/keyfile.json",
    }),
  ],
})
export class AppModule {}
export class Service {
  constructor(private readonly service: StorageService) {}

  public async uploadFile(): Promise<void> {
    const dataPath = "local-path.txt";
    await this.service.upload<GoogleCloudStorageUploadOptions>(dataPath, "path/to/test.txt", { gzip: true });
  }
}