1.1.7 • Published 2 years ago

@novo-x/aws-s3 v1.1.7

Weekly downloads
-
License
ISC
Repository
-
Last release
2 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

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago