javascriptv3/example_code/nodegetstarted/README.md
This guide shows you how to initialize an NPM package, add a service client to your package, and use the JavaScript SDK to call a service action.
Create a new NPM package with one main file that does the following:
Before you can run the example, you must do the following:
npm init -y. This creates a default package.json file."type": "module" to the package.json. This tells Node we're using modern ESM syntax.The final package.json should look similar to this:
{
"name": "example-javascriptv3-get-started-node",
"version": "1.0.0",
"description": "This guide shows you how to initialize an NPM package, add a service client to your package, and use the JavaScript SDK to call a service action.",
"main": "index.js",
"scripts": {
"test": "vitest run unit"
},
"author": "Corey Pyle <[email protected]>",
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/client-s3": "^3.420.0"
},
"type": "module"
}
npm i @aws-sdk/client-s3.node index.js