dynamoDB
A node js module for accessing Amazon DynamoDB
Last updated 8 years ago by xiepeng .
Repository · Original npm · Tarball · package.json
$ cnpm install dynamoDB 
SYNC missed versions from official npm registry.

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);
        });
});

Current Tags

  • 0.1.4                                ...           latest (8 years ago)

7 Versions

  • 0.1.4                                ...           8 years ago
  • 0.1.3                                ...           8 years ago
  • 0.1.2                                ...           8 years ago
  • 0.1.1                                ...           8 years ago
  • 0.1.0                                ...           8 years ago
  • 0.0.2                                ...           8 years ago
  • 0.0.1                                ...           8 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |