Gathering detailed insights and metrics for react-aws-s3-typescript
Gathering detailed insights and metrics for react-aws-s3-typescript
Gathering detailed insights and metrics for react-aws-s3-typescript
Gathering detailed insights and metrics for react-aws-s3-typescript
react-aws-s3
Open Source Module to Upload your Media and files into AWS S3 Bucket directly from Front-end React.
fy-react-aws-s3
Open source npm package to upload your files into AWS S3 Bucket directly using react(typescript template)
react-s3-typescript
A npm package to upload your files into AWS S3 Bucket directly using react
karma-dev-react-aws-s3-typescript
Open source npm package to upload your files into AWS S3 Bucket directly using react(typescript template)
Open source npm package to upload your files into AWS S3 Bucket directly using react(typescript template)
npm install react-aws-s3-typescript
Typescript
Module System
Node Version
NPM Version
v2.0.0
Updated on Oct 29, 2024
v1.1.5
Updated on Dec 06, 2022
Fixing Buffer undefined error
Updated on Jul 26, 2022
Patch type declaration for aws-sdk
Updated on Sep 23, 2021
Added publicUrl to Content array of listFiles function
Updated on Sep 23, 2021
Update README.md
Updated on Aug 06, 2021
TypeScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
11 Stars
23 Commits
6 Forks
2 Watchers
2 Branches
2 Contributors
Updated on Apr 14, 2025
Latest Version
2.0.0
Package Id
react-aws-s3-typescript@2.0.0
Unpacked Size
25.22 kB
Size
6.81 kB
File Count
18
NPM Version
9.5.1
Node Version
18.16.1
Published on
Oct 29, 2024
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Open source npm package to upload your files into AWS S3 Bucket directly using react(typescript template)
Open source npm package to upload your media and other types of files directly into AWS S3 Bucket using react typescript template. You can upload and retrive the public url for the file and delete the files if needed.
You need to have an AWS account to use AWS S3 Bucket. If you already do not have an account, create an account here.
Readmore about AWS S3 buket: https://docs.aws.amazon.com/s3/index.html
Using npm
1$ npm install react-aws-s3-typescript
You can define a default directory for uploads using the s3Config object
1 /* AWS S3 config options */ 2 /* Highly recommended to declare the config object in an external file import it when needed */ 3 4 /* s3Config.ts */ 5 6 export const s3Config = { 7 bucketName: 'bucket-name', 8 dirName: 'directory-name', /* Optional */ 9 region: 'ap-south-1', 10 accessKeyId:'ABCD12EFGH3IJ4KLMNO5', 11 secretAccessKey: 'a12bCde3f4+5GhIjKLm6nOpqr7stuVwxy8ZA9bC0', 12 s3Url: 'https:/your-aws-s3-bucket-url/' /* Optional */ 13 } 14 15 /* End of s3Config.ts */
1 /* AWS S3 Client */ 2 /* uploadFile.ts */ 3 import ReactS3Client from 'react-aws-s3-typescript'; 4 import { s3Config } from './s3Config.ts'; 5 6 const uploadFile = async () => { 7 /* Import s3 config object and call the constrcutor */ 8 const s3 = new ReactS3Client(s3Config); 9 10 /* You can use the default directory defined in s3Config object 11 * Or you can a define custom directory to upload when calling the 12 * constructor using js/ts object destructuring. 13 * 14 * const s3 = new ReactS3Client({ 15 * ...s3Config, 16 * dirName: 'custom-directory' 17 * }); 18 * 19 */ 20 21 const filename = 'filename-to-be-uploaded'; /* Optional */ 22 23 /* If you do not specify a file name, file will be uploaded using uuid generated 24 * by short-UUID (https://www.npmjs.com/package/short-uuid) 25 */ 26 27 try { 28 const res = await s3.uploadFile(file, filename); 29 30 console.log(res); 31 /* 32 * { 33 * Response: { 34 * bucket: "bucket-name", 35 * key: "directory-name/filename-to-be-uploaded", 36 * location: "https:/your-aws-s3-bucket-url/directory-name/filename-to-be-uploaded" 37 * } 38 * } 39 */ 40 } catch (exception) { 41 console.log(exception); 42 /* handle the exception */ 43 } 44 } 45 46 /* End of uploadFile.ts */
1 /* AWS S3 Client */ 2 /* listFiles.ts */ 3 import ReactS3Client from 'react-aws-s3-typescript'; 4 import { s3Config } from './s3Config.ts'; 5 6 const listFiles = async () => { 7 /* Import s3 config object and call the constrcutor */ 8 const s3 = new ReactS3Client(s3Config); 9 10 try { 11 const fileList = await s3.listFiles(); 12 13 console.log(fileList); 14 /* 15 * { 16 * Response: { 17 * message: "Objects listed succesfully", 18 * data: { // List of Objects 19 * ... // Meta data 20 * Contents: [] // Array of objects in the bucket 21 * } 22 * } 23 * } 24 */ 25 } catch (exception) { 26 console.log(exception); 27 /* handle the exception */ 28 } 29 } 30 31 /* End of listFiles.ts */
1 /* AWS S3 Client */ 2 /* deleteFile.ts */ 3 import ReactS3Client from 'react-aws-s3-typescript'; 4 import { s3Config } from './s3Config.ts'; 5 6 const deleteFile = async () => { 7 /* Import s3 config object and call the constrcutor */ 8 const s3 = new ReactS3Client(s3Config); 9 10 /* Define the filepath from the root of the bucket to the file to be deleted */ 11 const filepath = 'directory-name/filename-to-be-deleted'; 12 13 try { 14 await s3.deleteFile(filepath); 15 16 console.log('File deleted'); 17 } catch (exception) { 18 console.log(exception); 19 /* handle the exception */ 20 } 21 } 22 23 /* End of deleteFile.ts */
Important : Add public-read
Canned ACL to the bucket to grant the public read access for files.
Read more: https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#canned-acl
These are the available config options for calling the S3 constructor bucketName
, region
, accessKeyId
and secretAccessKey
are required. Upload will default to root path, if dirName
is not specified.
This react-aws-s3-typescript
package is heavily inspired by the react-aws-s3
package provided by developer-amit.
Released under MIT license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
security policy file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
Found 1/23 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More