Get started quickly using AWS with the AWS SDK for JavaScript in Node.js. The SDK helps take the complexity out of coding by providing JavaScript objects for AWS services including Amazon S3, Amazon EC2, DynamoDB, and Amazon SWF. The single, downloadable package includes the AWS JavaScript Library and documentation.


npm install aws-sdk

Create a credentials file at ~/.aws/credentials on Mac/Linux or C:\Users\USERNAME\.aws\credentials on Windows

[default]

aws_access_key_id = your_access_key

aws_secret_access_key = your_secret_key

The Getting Started Guide covers other means to load credentials.

var AWS = require('aws-sdk');
var s3 = new AWS.S3();

s3.createBucket({Bucket: 'myBucket'}, function() {
  var params = {Bucket: 'myBucket', Key: 'myKey', Body: 'Hello!'};
  s3.putObject(params, function(err, data) {
      if (err)
          console.log(err)
      else console.log("Successfully uploaded data to myBucket/myKey");
   });
});



Connect with other developers in the JavaScript Community Forum »

Discover more about using JavaScript with AWS in the JavaScript Developer Center »

Learn the details of the latest SDK in the Release Notes »

Dig through the source code in the GitHub Repository »