Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aws2js

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws2js

AWS (Amazon Web Services) APIs client implementation for node.js

  • 0.2.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
270
decreased by-19.88%
Maintainers
1
Weekly downloads
 
Created
Source

About

Amazon Web Services node.js module. Currently under development. This is basically a fork of aws-lib which served as most of the inspiration for this module. While it resembles its original structure, some of the internal workings are changed due to obvious reasons.

Installation

Either manually clone this repository into your node_modules directory, or the recommended method:

npm install aws2js

Design goals

  • HTTPS-only APIs communication
  • Proper error reporting
  • Simple to write clients for a specific AWS service
  • Simple to use AWS API calls

For example, the EC2 client, as implemented into the library is just:

exports.ec2 = client({
	prefix: 'ec2',
	path: '/',
    query: {
    	Version: '2011-05-15',
    	SignatureMethod: 'HmacSHA256',
		SignatureVersion: '2'
    }
});

Abstracting most of the AWS APIs plumbing is the actual goal behind the client simplicity.

Supported services

  • EC2 (require('aws2js').ec2)
  • RDS (require('aws2js').rds)
  • SES (require('aws2js').ses)

More will come. Remember, this is under active development, but an early release. I still need S3 support (at least) for my own usage.

Usage mode

var ec2 = require('aws2js').ec2;

ec2.setCredentials('accessKeyId', 'secretAccessKey'); // Mandatory.
ec2.setRegion('eu-east-1'); // Optional. The us-east-1 region is the default API entry point anyway.

// action, query, callback - for the action and query parameters, check the EC2 API reference.
ec2.call('DescribeVolumes', {}, function (error, response) {
	if ( ! error) {
		for (var i in response.volumeSet.item) {
			console.log(response.volumeSet.item[i]);
		}
	} else {
		console.error(error);
	}
});

A config() method is provided for the service client. You may invoke it as:

ec2.config({
	accessKeyId: 'accessKeyId',
	secretAccessKey: 'secretAccessKey',
	host: 'ec2.us-west-1.amazonaws.com'
});

This is the equivalent of calling setCredentials() and setRegion() but it is more verbose and error prone. However, it may change the internals of the service client, therefore usable for fine tuning the service client at a lower level if a direct approach via implemented properties isn't available.

The returned error into the callback is an Error instance. If it's an error generated by the AWS API itself, the response argument contains the raw object returned by the AWS API. Currently there isn't implemented a method to get the actual error message from the response error due to the fact that the AWS APIs don't use a standardized format for all the APIs. Implementing the errors specifications into the service client is planned.

Notice

  • Amazon SES doesn't have multiple regions. By default it uses us-east-1. The ses.setRegion() call is disabled for this client.

FAQs

Package last updated on 08 Dec 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc