Node.js用AWS SDKがリリースされました

AmazonのCTOであるWerner Vogelは、最近のre:Inventカンファレンスで、日々のタスクにNode.jsを使用していると述べました。 12月4日に、 Node.js用の公式AWS SDKがリリースされました 。 現在、サードパーティのライブラリを使用する必要はありません。その安定性を恐れ、ドキュメントを理解しようとしています。

現在、SDKは以下をサポートしています。


使用するには、新しいモジュールをインストールするのに十分です
npm install aws-sdk 

明確にするための例:
 var AWS = require('aws-sdk'); AWS.config.loadFromPath('./path/to/credentials.json'); AWS.config.update({region: 'us-east-1'}); var s3 = new AWS.S3(); s3.client.createBucket({Bucket: 'myBucket'}).done(function(resp) { var data = {Bucket: 'myBucket', Key: 'myKey', Body: 'Hello!'}; s3.client.putObject(data).done(function(resp) { console.log("Successfully uploaded data to myBucket/myKey"); }); }).fail(function(resp) { console.log(resp.error); }); 


参照資料


Source: https://habr.com/ru/post/J161665/


All Articles