@novo-x/aws-s3
TypeScript icon, indicating that this package has built-in type declarations

1.1.7 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i @novo-x/aws-s3

Weekly Downloads

31

Version

1.1.7

License

ISC

Unpacked Size

79.1 kB

Total Files

6

Last publish

Collaborators

  • lautarobruno
  • agustin-novolabs
  • novo-tincho
  • nicolas.novolabs
  • mati-novolabs
  • alejitowow
  • nahuelprieto