Skip to content

JavascriptIsMagic/coaws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

coaws

A co-ready aws-sdk wrapper

Intended to function exactly the same as the aws-sdk module, except you yield instead of pass in callbacks, (intended to support all aws-sdk services.)

Examples:

yield s3.listBuckets

co = require 'co'
{S3} = require 'coaws'

s3 = new S3
  accessKeyId: 'QWERTYUIOPASDFGHJKLZ'
  secretAccessKey: 'QweRTyuIopasDfgHjKlzXcvBNm12q43wWERTY45E'
  region: 'us-east-1'
co ->
  list = yield s3.listBuckets()
  console.log list

yield ses.sendEmail

co = require 'co'
{SES} = require 'coaws'

ses = new SES
  accessKeyId: 'QWERTYUIOPASDFGHJKLZ'
  secretAccessKey: 'QweRTyuIopasDfgHjKlzXcvBNm12q43wWERTY45E'
  region: 'us-east-1'
co ->
  result = yield ses.sendMail
    Destination: ToAddresses: ['example@gmail.com']
    Message:
      Subject: Data: 'Example'
      Body:
        Text: Data: 'This is an Example Email.'
        Html: Data: '<h1 style="color:red;">This is an Example Email.</h1>'

About

Small glue wrapper for making aws-sdk compatable with co.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published