1.1.7 • Published 3 years ago

@novo-x/aws-s3 v1.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

AWS S3 Service

Available methods

  • upload: uploads a file to the bucket
  • getPresignedUrlForFile: retrieves a presigned url for a file
  • download: downloads a file from the bucket
  • delete: deletes a file from the bucket
  • updateAwsConfig: updates the aws config

Usage examples

yarn add @novo-x/aws-s3

import {S3} from "@novo-x/aws-s3"

const MyService = new S3(
    'mybucket', // bucket 
    {}, // optional s3 instance config
);

const upload = await MyService.upload(
    'folder_name/123456789', // objectKey
    '8172638123', // fileStream
    'public-read', // ACL
    'image/png' // contentType
)

MyService.updateAwsConfig({
    // ... AWS config
})

const presignedUrl = await MyService.getPresignedUrlForFile(
    'folder_name/123456789' // objectKey
)

const image = await MyService.download(
    'folder_name/123456789' // objectKey
)

const response = await MyService.delete(
    'folder_name/123456789' // objectKey
)

Dependencies

aws-sdk

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago