@anchan828/nest-storage-gcs
v1.0.94
Published
> TODO: description
Downloads
773
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 });
}
}