@anchan828/nest-storage-gcs
TypeScript icon, indicating that this package has built-in type declarations

1.0.94 • Public • Published

@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 });
  }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @anchan828/nest-storage-gcs

Weekly Downloads

471

Version

1.0.94

License

MIT

Unpacked Size

16 kB

Total Files

12

Last publish

Collaborators

  • anchan828