You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

aws-sdk-promise

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aws-sdk-promise

Hack for adding the .promise() method to all aws-sdk request objects (aws-sdk is a peerDependency)

0.0.2
latest
Source
npmnpm
Version published
Weekly downloads
47
95.83%
Maintainers
2
Weekly downloads
 
Created
Source

aws-sdk-promise

Hack for adding the .promise() method to all aws-sdk request objects (aws-sdk is a peerDependency).

How it works?

Take a look at the source the short version its a terrible hack into the AWS.Request object (which aws-sdk returns from just about all api calls).

Usage

// AWS is identical to aws-sdk but it has .promise method on all
// requests
var AWS = require('aws-sdk-promise');
var ec2 = new AWS.EC2({ region: 'us-west-2' });

ec2.describeAccountAttributes({}).promise().then(
  function(req) {
    // the promise is resolved on the 'complete' event of request object
    console.log(JSON.stringify(req.data, null, 2));
  },
  function(error) {
    // rejected if the 'complete' event contains an error
    console.log(error);
  }
);

Credit: https://github.com/aws/aws-sdk-js/issues/13#issuecomment-11868232

Keywords

aws

FAQs

Package last updated on 29 Jan 2015

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