Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 78 lines (55 sloc) 2.083 kB
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
1 # AWS SDK for Node.js
d120626 @lsegal Add basic README, update package.json
lsegal authored
2
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
3 The official JavaScript implementation of the AWS SDK for Node.js.
d120626 @lsegal Add basic README, update package.json
lsegal authored
4
5 ## Installing
6
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
7 The preferred way to install the AWS SDK for Node.js is to use the
8 [npm](http://npmjs.org) package manager for Node.js. Simply type the following
9 into the a terminal window:
d120626 @lsegal Add basic README, update package.json
lsegal authored
10
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
11 ```sh
12 npm install aws-sdk
d120626 @lsegal Add basic README, update package.json
lsegal authored
13 ```
14
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
15 ## Usage
d120626 @lsegal Add basic README, update package.json
lsegal authored
16
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
17 After you've installed the SDK, you can require the AWS package in your node
18 application using `require`:
d120626 @lsegal Add basic README, update package.json
lsegal authored
19
20 ```js
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
21 var AWS = require('aws-sdk');
d120626 @lsegal Add basic README, update package.json
lsegal authored
22 ```
23
f2d4016 @carljparker editorial review
carljparker authored
24 Here is a quick example that makes some requests against Amazon S3 with the SDK:
d120626 @lsegal Add basic README, update package.json
lsegal authored
25
26 ```js
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
27 // Load the AWS SDK for Node.js
28 var AWS = require('aws-sdk');
d120626 @lsegal Add basic README, update package.json
lsegal authored
29
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
30 /**
f2d4016 @carljparker editorial review
carljparker authored
31 * Don't hard-code your credentials!
32 * Load them from disk or your environment instead.
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
33 */
34 // AWS.config.update({accessKeyId: 'AKID', secretAccessKey: 'SECRET'});
3194a3f @trevorrowe Updated README (getting started guide).
trevorrowe authored
35
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
36 // Instead, do this:
37 AWS.config.loadFromPath('./path/to/credentials.json');
3194a3f @trevorrowe Updated README (getting started guide).
trevorrowe authored
38
f2d4016 @carljparker editorial review
carljparker authored
39 // Set your region for future requests.
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
40 AWS.config.update({region: 'us-east-1'});
3194a3f @trevorrowe Updated README (getting started guide).
trevorrowe authored
41
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
42 // Create a bucket and put something in it.
43 var s3 = new AWS.S3();
9f2313b @lsegal Update API in guide docs
lsegal authored
44 s3.client.createBucket({Bucket: 'myBucket'}).done(function(resp) {
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
45 var data = {Bucket: 'myBucket', Key: 'myKey', Body: 'Hello!'};
46 s3.putObject(data).done(function(resp) {
47 console.log("Successfully uploaded data to myBucket/myKey");
48 });
3194a3f @trevorrowe Updated README (getting started guide).
trevorrowe authored
49 });
d120626 @lsegal Add basic README, update package.json
lsegal authored
50 ```
51
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
52 ## Getting Started Guide
d120626 @lsegal Add basic README, update package.json
lsegal authored
53
f2d4016 @carljparker editorial review
carljparker authored
54 You can find a getting started guide at:
3194a3f @trevorrowe Updated README (getting started guide).
trevorrowe authored
55
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
56 http://TBD
3194a3f @trevorrowe Updated README (getting started guide).
trevorrowe authored
57
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
58 ## License
d120626 @lsegal Add basic README, update package.json
lsegal authored
59
60 This SDK is distributed under the
61 [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).
62
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
63 ```no-highlight
f2d4016 @carljparker editorial review
carljparker authored
64 Copyright 2012. Amazon Web Services, Inc. All Rights Reserved.
d120626 @lsegal Add basic README, update package.json
lsegal authored
65
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
66 Licensed under the Apache License, Version 2.0 (the "License");
67 you may not use this file except in compliance with the License.
68 You may obtain a copy of the License at
d120626 @lsegal Add basic README, update package.json
lsegal authored
69
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
70 http://www.apache.org/licenses/LICENSE-2.0
d120626 @lsegal Add basic README, update package.json
lsegal authored
71
5b8905c @lsegal Add initial getting started guide docs
lsegal authored
72 Unless required by applicable law or agreed to in writing, software
73 distributed under the License is distributed on an "AS IS" BASIS,
74 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
75 See the License for the specific language governing permissions and
76 limitations under the License.
77 ```
Something went wrong with that request. Please try again.