aws-connector
v0.7.4
Published
Connector for the following AWS services: dynamo, sns, sqs
Downloads
19
Readme
AWS Connector
A wrapper around some aws-sdk components, adding a promised based interface.
The connector has two jobs:
- Provide a promised based interface to some aws components.
- Allow a base configuration to be set that is used as a base for each client that is created. This allows easy creation of clients which only differ in their authenciation details.
Other than this, the connector is completely transparent and simply mirrors the behaviour of the aws-sdk.
Usage for DynamoDB
var AWSConnector = require('aws-connector');
//Add a base configuration.
AWSConnector.dynamo.configure({ region: 'foo' });
//Make a request
AWSConnector.dynamo
//Extend the base configuration with connection info.
.connect({ accessKeyId: 'key', secretAccessKey: 'secret' })
//Do your operation. It will return a promise.
.scan({ TableName: 'books' })
.then(function(books) {
console.log(books)
});
The options passed to dynamo.configure
and dynamo.connect
are passed
directly to the aws-sdk DynamoDB client constructor.
Development
Style
We have an .editorconfig
file to help us having a consistent coding style.
Please install a plugin for your editor.
We use jshint
for code linting.
There are plugins for that too.
Tasks
We use gulp as a task runner. Install it globally first: npm install -g gulp
.
To see a list of gulp commands, run:
gulp help
Git hooks
In the package.json
you can see a pre-commit and pre-push hook.
On commiting or pushing these commands are executed.
If they fail, the commit/push will fail.
Add the --no-verify
flag to your commit or push to bypass these checks.