@anchan828/nest-storage-s3

> TODO: description

Usage no npm install needed!

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

README

@anchan828/nest-storage-s3

Install

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

Usage

@Module({
  imports: [
    StorageModule.register({
      bucket: "bucket",
      cacheDir: "path/to/cacheDir",
    }),
    S3ProviderModule.register({
      accessKeyId: "AWSAccessKeyId",
      secretAccessKey: "AWSSecretKey",
    }),
  ],
})
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<S3StorageUploadOptions>(dataPath, "path/to/test.txt", { Expires: new Date("2020-1-1") });
  }
}