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