4.0.0 • Published 2 months ago

@erento/nestjs-module-aws v4.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
2 months ago

NestJS AWS module

Currently supports:

  • S3 upload

How to use it

  1. Import this module in the module you want to use it as:

    imports: [
        AwsModule.forRoot(
            'eu-west-1',
            'my-bucket-name',
            'my/folder-structure',
            './config/aws.credentials.json',
        ),
    ]
  2. Upload a file:

    Import the S3Client service via dependency injection to your service and use it as follows:

    • Body as a text:

      await this.S3Client.upload('folder/file-name.jpg', 'some text');
    • Body as a @UploadedFile from FileInterceptor:

      await this.S3Client.upload('folder/file-name.jpg', uploadedFile.buffer);

    You can also provide S3 upload options to any request via 3rd argument.

Stay in touch

License

This module is MIT licensed.

4.0.0

2 months ago

3.0.0

2 years ago

2.2.0

4 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.0.0

6 years ago