luds3 v0.1.2
luds3
This is a CLI tool that enables fast content listing of S3 buckets. Also, it allows to easily upload, download and delete files.
Table of Contents
Installation
npm install luds3Getting Started
By running the --help, the luds3 will print out all required to get you started:
trantor@guy:~/$ luds3 --help
Usage: luds3 [options] [command]
Options:
-h, --help display help for command
Commands:
set-credentials [options] Setup aws IAM user credentials to access S3 resources.
get-credentials Get user credentials for IAM user.
run-api [options] Deploys the api to list and download items from the bucket param.
list [options] Lists all items and folders inside a bucket.
download [options] Downloads file from S3 bucket.
upload [options] Uploads file in S3 bucket.
delete [options] Deletes file in S3 bucket.
help [command] display help for commandPrerequisites
luds3 requires an IAM account with full privileges to access the S3 resources where the S3 buckets to perform all operations, reside.
Usage
luds3 consists of the following commands:
- The
set-credentialscommand will help you setup the ACCESS KEY, SECRET ACCESS KEY and REGION. - The
listcommand will iterate over a chosenbucketand list all items - The
downloadcommand will download a chosen item with a specificprefixfrom inside abucket - The
uploadcommand will upload an item from local storage inside a chosenbucket - The
deletecommand will delete an item in a chosenbucket - The
run-servercommand will deploy an express server which will list atlocalhost:8008the items of a bucket giving the opportunity to download any of them.
Examples
Set-Credentials:
trantor@guy:~/$ luds3 set-credentials -accesskey AKIISDHHTNHOJKIEMWGM3C -secretkey jd78day7d78878NnNAS/PQ+Rmt6IWJDIDtmjd -region eu-central-1List:
trantor@guy:~/$ luds3 list -bucket mymages
2022-12-21 23:03:39 info: Valid S3 bucket.
2022-12-21 23:03:40 info: blue/
2022-12-21 23:03:40 info: blue/pexels-anjana-c-674010.jpg -- 1018 KB
2022-12-21 23:03:40 info: green/
2022-12-21 23:03:40 info: green/pexels-pixabay-414102.jpg -- 229 KB
2022-12-21 23:03:40 info: purple/
2022-12-21 23:03:40 info: purple/term-bg-1-3d6355ab.jpg -- 43 KB
2022-12-21 23:03:40 info: purple/test.jpg -- 1018 KB
2022-12-21 23:03:40 info: red/
2022-12-21 23:03:40 info: red/pexels-pixabay-206359.jpg -- 569 KB
2022-12-21 23:03:40 info: test.jpg -- 1018 KB
2022-12-21 23:03:40 info: yellow/Delete:
luds3 delete -bucket mymages -key purple/test.jpgUpload:
luds3 upload -bucket mymages -filepath /home/guy/Documents/test/test.jpg -prefix purpleDownload:
luds3 download -bucket mymages -key blue/pexels-anjana-c-674010.jpgRun-Server:
luds3 run-server -bucket mymagesDevelopment
Installing Node and NPM is pretty straightforward using the installer package available from the (Node.js® web site)https://nodejs.org/en/. Having NPM installed, several dependencies should be installed as described in the next section.
Using NPM, install system specific software dependencies enclosed to package.json.
npm installLicense
MIT -- take a look LICENSE