1.0.2 • Published 4 years ago

@samwen/aws-s3-utils v1.0.2

Weekly downloads
5
License
ISC
Repository
github
Last release
4 years ago

aws-s3-utils

an useful collection of utils for aws s3 operations.

how to install

npm install @samwen/aws-s3-utils --save

how to use

const { updateAwsConfig, uploadFileToBucket, uploadFolderToBucket } = require('@samwen/aws-s3-utils');

const my_bucket = 'my_bucket';

const aws_credentials = {
    accessKeyId: 'MyAccessKeyId', 
    secretAccessKey: 'MySecretAccessKey',
    region: "us-east-1" 
};

updateAwsConfig(aws_credentials);

await uploadFileToBucket('/tmp/aws-s3-test/test_folder/a', my_bucket, 'test_folder/a');

await uploadFolderToBucket('/tmp/aws-s3-test/test_folder/', my_buckt, 'test_folder2');