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

1.0.2 • Public • Published

@dieover/aws-s3

npm install @dieover/aws-s3 --save

const AWSS3 = require('@dieover/aws-s3');

const aws = new AWSS3({
    ACCESS_KEY_ID: '',
    SECRET_ACCESS_KEY: '',
    S3_REGION: '',
    S3_BUCKET: '',
    S3_VERSION: ''
});
const photo_url = await aws.upload('data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQAB...', 'images', 'new');
const deleted = await aws.delete(photo_url);

Upload

  • BASE64: data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQAB...
  • FOLDER: images/something/else
  • FILENAME: filename
  • SUCCESS RETURN: Photo URL.
  • FAILED RETURN: Failed to save image.
aws.upload(base64, folder, filename);

Delete

aws.delete(PHOTO_URL);

Package Sidebar

Install

npm i @dieover/aws-s3

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

8.07 kB

Total Files

5

Last publish

Collaborators

  • lennonmilicic