This is a workspace where you can find working AWS SDK for JavaScript version 3 (v3) Amazon S3 examples.
The preview version of the AWS SDK for JavaScript v3 is available.
The AWS SDK for JavaScript v3 Developer Guide contains these examples.
Amazon S3 is an object storage service that offers industry-leading scalability, data availability, security, and performance.
NOTE: The AWS SDK for JavaScript v3 is written in TypeScript so, for consistency, these examples are also in TypeScript. TypeScript extends of JavaScript so these examples can also be run as JavaScript. For more information, see TypeScript homepage.
-
Clone the AWS SDK Code Samples repo to your local environment. See the Github documentation for instructions.
-
Install the dependencies listed in the package.json.
Note: These dependencies include the client modules for the AWS services that this example requires, which is @aws-sdk/client-s3, @aws-sdk/client-cognito-identity, @aws-sdk/credential-provider-cognito-identity, @aws-sdk/s3-request-presigner, @aws-sdk/util-create-request, @aws-sdk/util-format-url, and node-fetch.
npm install ts-node -g // If using JavaScript, enter 'npm install node -g' instead
cd javascriptv3/example_code/s3
npm install
-
If you're using JavaScript, change the sample file extension from
.tsto.js. -
In your text editor, update user variables specified in the
Inputssection of the sample file. -
Run sample code:
cd src
ts-node [example name].ts // e.g., ts-node s3.ts