npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aws-promjs

v0.1.3

Published

Decorates AWS SDK to use promises while maintaining exact same API as read in aws docs. Config available to exclude/add service methods.

Downloads

5

Readme

AWS-PromJS

AWS SDK wrapper which converts the standard AWS API Service methods into functions which will return a promise rather than take a callback. The Service objects are decorated based off a list of names in and can be easily extended or overwritten. So, what is the difference between AWS-PromJS and other modules that that wrap AWS Service methods to return a promise? Not much except for:

  • The names are the same! The AWS methods names your used to, no changes!
  • Explicit control through config of which methods return a promise and which don't.
  • Your setup and AWS configuration doesn't change. It should be identical to your old code. Only service object methods return promises.
  • If AWS-PromJS doesn't support the Service object your using, just add the service object namespace into inc/aws-promjs.json with an Array containing every method name, or create your own config file in project root /aws-promjs.json.
  • If you don't want a promise returned from a specific method, add that method name to an Array under `exclude <service-name> in a config file.
// Require 'aws-promjs' instead of 'aws-sdk'.
var AWS = require('aws-promjs');

// Configuration code should work exactly as AWS.
AWS.config.loadFromPath('./path/to/AWS/config.json');
AWS.config.region = 'us-east-1';

// Service creation is the same as AWS.
var s3 = new AWS.S3();

// Service method names the same as AWS!
s3.createBucket({Bucket: 'Quite spiffy ole chap'})
  // except that they return a promise rather than use callbacks
  .then(function(data) {
    console.log('promise resolved', data)
  })
  .catch(function(err) {
    console.log('promise failed', err);
  });

This is a list of all the services returning promises out of the box and their version numbers. Most of these are untested at the moment and I could use some help finding any issues. If there is a service not listed here, it will still work the same as it did without aws-promjs. If you want to add a service that is not listed here, just follow the same convention used in the ./inc/aws-promjs.json file, but do so in your own aws-promjs.json file within your projects root directory so it doesn't get overwritten on update.

  • AutoScaling version: [2011-01-01].
  • CloudFormation version: [2010-05-15].
  • CloudFront version: [2014-10-21].
  • CouldSearch version: [2013-01-01].
  • CloudSearchDomain version: [2013-01-01].
  • CloudWatch version: [2010-08-01].
  • CloudWatchLogs version: [2014-03-28].
  • CognitoIdentity version: [2014-06-30].
  • CognitoSync version: [2014-06-30].
  • DynamoDB version: [2012-08-10].
  • EC2 version: [2014-10-01].
  • ECS version: [2014-11-13].
  • EMR version: [2009-03-31].
  • ElasticTranscoder version: [2012-09-25].
  • ElastiCache version: [2014-09-30].
  • Glacier version: [2012-06-01].
  • Kinesis version: [2013-12-02].
  • Redshift version: [2012-12-01].
  • RDS version: [2014-09-01].
  • Route53 version: [2013-04-01].
  • Route53Domains version: [2014-05-15].
  • SES version: [2010-12-01].
  • SNS version: [2010-03-31].
  • SQS version: [2012-11-05].
  • S3 version: [2006-03-01]

Footnotes

Note:

  • The config json files are not asyncronous because if they were then we wouldn't be able to return the AWS object using the same API as AWS-SDK. This may change in the future, rather than immediately return the AWS main object from require('aws-promjs') it may be better to return a promise there as well. I want to see how the promises in the service namespaces work out first.

Feel free to contribute lists of method names

Since you should only need a list of the method names in an AWS Service object to convert it. If you compile a list of all the method names in an object feel free to send it over to [email protected] and I will try to add it.