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

1.0.87 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i @anchan828/nest-storage-s3

Weekly Downloads

71

Version

1.0.87

License

MIT

Unpacked Size

20.2 kB

Total Files

16

Last publish

Collaborators

  • anchan828