AWS News Blog

AWS SDK for Node.js – Now Available in Preview Form

Voiced by Polly

The AWS Developer Tools Team focuses on delivering the developer tools and SDKs that are a good fit for today’s languages and programming environments.

Today we are announcing support for the JavaScript language in the Node.js environment — the new AWS SDK for Node.js.

Node.js gives you the power to write  server-side applications in JavaScript. It uses an event-driven non-blocking I/O model to allow your applications to scale while keeping you from having to deal with threads, polling, timeouts, and event loops. You can, for example, initiate and manage parallel calls to several web services in a clean and obvious fashion.

The SDK is available as an npm (Node Packaged Module) at https://npmjs.org/package/aws-sdk. Once installed, you can load it into your code and configure it as follows:

var AWS = require(‘aws-sdk’);

AWS.config.update({
accessKeyId: ‘ACCESS_KEY’,
secretAccessKey: ‘SECRET_KEY’,
region: ‘us-east-1’
});

Then you create a service interface object:

var s3 = new AWS. S3 ( ) ;

You can then use the object to make requests. Here’s how you would upload a pair of objects into Amazon S3 concurrently:

var params1 = {Bucket : ‘myBucket’ , Key : ‘myKey1’ , Body : ‘Hello!’ } ;
var params2 = {Bucket : ‘myBucket’ , Key : ‘myKey2’ , Body : ‘World!’ } ;s3. client.putObject (params1 ). done ( function (resp ) {
console. log ( “Successfully uploaded data to myBucket/myKey1” ) ;
} ) ;

s3.client.putObject(params2).done(function(resp) {
console.log(“Successfully uploaded data to myBucket/myKey2”);
});

The SDK supports Amazon S3, Amazon EC2, Amazon DynamoDB, and the Amazon Simple Workflow Service, with support for additional services on the drawing board.

Here are some links to get you going:

Give it a shot and let me know what you think!

— Jeff;

PS – The AWS Developer Tools Team is hiring! Here are some of their openings:

Modified 10/29/2020 – In an effort to ensure a great experience, expired links in this post have been updated or removed from the original post.
TAGS:
Jeff Barr

Jeff Barr

Jeff Barr is Chief Evangelist for AWS. He started this blog in 2004 and has been writing posts just about non-stop ever since.