A package to handle the S3 requests
npm install @janiscommerce/s3
The methods that can be used are:
getObject
putObject
deleteObject
listObjects
listBuckets
createBucket
deleteBucket
const S3 = require('@janiscommerce/s3');
const putObjectParams = {
Body: 'body',
Bucket: 'bucketName',
Key: `objectKey`
};
const s3Response = S3.putObject(putObjectParams);
return s3Response.then(response => {
// do some stuf with the success
}).cath(err => {
// do some stuf with the error
})