3.0.0 • Published 2 years ago

snce-aws-utils v3.0.0

Weekly downloads
138
License
ISC
Repository
github
Last release
2 years ago

AWS S3 Bucket Utils

js-standard-style

AWS Helper for manage file on AWS S3 bucket, available methods:

Requirement

AWS S3 bucket with valid credentials, access key using profile stored in .aws/credentials or using key from .env file

Installation

Using npm:

$ npm i -g npm
$ npm i snce-aws-utils

Usage

Require module:

// Load aws-s3-utils.
const snceS3Utils = require('snce-aws-utils');

Module Init

Two different authentication method available for S3:

  • .ENV file
  • AWS Profile

.ENV

Sample of .env file

#FRONTEND LOCAL S3 BUCKET
KEYLOCAL=
BUCKETLOCAL=
SECRETLOCAL=

Profile

Set profile name and ensure that you already set valid credentials on AWS

Upload

Upload function to be used: upload() Parameter explanation:

   * Upload files from given folder on AWS S3 bucket
   * @param {string} buildFolder folder to be uploaded.
   * @param {string} destinationFolder destination folder on S3 bucket
   * @param {string} releaseName name of the release to be used (optional) fallback is the string into MANIFEST file.
   * @param {string[]} compressedFileExt list of file extension gzipped in order to set right content encoding value (optional)
   * @param {boolean} noReleaseName flag for not using any release name: file will be uploaded directly on root of the bucket (optional)
   * @param {string} acl to be used during uploading file (optional: public-read as default)

Delete

Upload function to be used: delete() Parameter explanation:

   * Delete single file  from given AWS S3 bucket
   * @param {string} filePath path for the file to be downloaded.

Download

Upload function to be used: download() Parameter explanation:

   * Download single file  from given AWS S3 bucket
   * @param {string} filePath path for the file to be downloaded.
3.0.0

2 years ago

2.0.0

2 years ago

1.22.0

3 years ago

1.21.0

3 years ago

1.19.0

3 years ago

1.18.0

3 years ago

1.17.0

3 years ago

1.20.0

3 years ago

1.16.1

3 years ago

1.15.0

3 years ago

1.16.0

3 years ago

1.14.0

3 years ago

1.13.0

3 years ago

1.12.0

3 years ago

1.11.0

3 years ago

1.10.0

3 years ago