AWS News Blog
AWS SDK for Node.js – Now Available in Preview Form
|
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:
You can then use the object to make requests. Here’s how you would upload a pair of objects into Amazon S3 concurrently:
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:
- AWS SDK for Node.js
- AWS SDK for Node.js Getting Started Guide
- AWS SDK for Node.js API Reference
- AWS SDK for Node.js on GitHub
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: