0.1.4 • Published 12 years ago

dynamoDB v0.1.4

Weekly downloads
29
License
-
Repository
github
Last release
12 years ago

dynamoDB.js - a node.js module for accessing Amazon DynamoDB.

Under development

DynamoDB uses JSON for communication. That means both the request body and the response are in JSON format. This module wraps up the request and takes care of authentication. The user will be responsible for crafting the request and parsing the result(both in JSON).

Usage:

// You can read your credentials from a local file.
var credentials = {AccessKeyId : "Your_AWS_Access_Key_Id", 
                   SecretKey   : "Your_Secret_Key"}; 
var dynamoDB = require('./lib/dynamoDB').DynamoDB(credentials);

Implemented features

CreateTable reference on aws

dynamoDB.createTable(
    {"TableName":"Table1",
        "KeySchema":
            {"HashKeyElement":{"AttributeName":"Color","AttributeType":"S"},
            "RangeKeyElement":{"AttributeName":"Weight","AttributeType":"N"}},
        "ProvisionedThroughput":{"ReadCapacityUnits":5,"WriteCapacityUnits":10}
    }, function(result) {
    result.on('data', function(chunk){
        console.log(""+chunk);
    });
});

ListTables reference on aws

dynamoDB.listTables({}, function(result) {
    result.on('data', function(chunk){
        console.log(""+chunk);
    });
});

DeleteTable reference on aws

dynamoDB.deleteTable({"TableName":"Table1"}, function(result) {
    result.on('data', function(chunk){
        console.log(""+chunk);
    });
});

DescribeTable reference on aws

dynamoDB.describeTable({"TableName":"Table1"}, function(result) {
    result.on('data', function(chunk){
        console.log(""+chunk);
    });
});

PutItem reference on aws

dynamoDB.putItem(
    {"TableName":"Table1",
        "Item":{
            "Color":{"S":"white"},
            "Name":{"S":"fancy vase"},
            "Weight":{"N":"2"}
        }
    }, function(result) {
        result.on('data', function(chunk){
            console.log(""+chunk);
        });
});

GetItem reference on aws

dynamoDB.getItem(
    {"TableName":"Table1",
        "Key":
            {"HashKeyElement": {"S":"white"},
            "RangeKeyElement": {"N":"2"}
        },
        "AttributesToGet":["Color","Weight", "Name"],
        "ConsistentRead":true
    }, function(result) {
        result.on('data', function(chunk){
            console.log(""+chunk);
        });
});
0.1.4

12 years ago

0.1.3

12 years ago

0.1.2

12 years ago

0.1.1

12 years ago

0.1.0

12 years ago

0.0.2

12 years ago

0.0.1

12 years ago