How do I promisify the AWS JavaScript SDK?

后端 未结 8 1098
面向向阳花
面向向阳花 2020-12-08 18:52

I want to use the aws-sdk in JavaScript using promises.

Instead of the default callback style:

dynamodb.getItem(params, function(err, data) {
  if (         


        
8条回答
  •  隐瞒了意图╮
    2020-12-08 19:21

    CascadeEnergy/aws-promised

    We have an always in progress npm module aws-promised which does the bluebird promisify of each client of the aws-sdk. I'm not sure it's preferable to using the aws-sdk-promise module mentioned above, but here it is.

    We need contributions, we've only taken the time to promisify the clients we actually use, but there are many more to do, so please do it!

提交回复
热议问题