Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llafuente/dynamodb-keyvalue
Use AWS dynamodb as a key/value storage.
https://github.com/llafuente/dynamodb-keyvalue
Last synced: 1 day ago
JSON representation
Use AWS dynamodb as a key/value storage.
- Host: GitHub
- URL: https://github.com/llafuente/dynamodb-keyvalue
- Owner: llafuente
- Created: 2016-11-24T15:31:41.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-11-24T15:34:05.000Z (about 8 years ago)
- Last Synced: 2024-12-08T15:44:21.434Z (21 days ago)
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# dynamodb-keyvalue
Use AWS dynamodb as a key/value storage.
Create table
```bash
aws dynamodb create-table --table-name lambda \
--attribute-definitions AttributeName=id,AttributeType=S \
--key-schema AttributeName=id,KeyType=HASH
```## API
```js
var KV = require('dynamodb-keyvalue');
KV.TableName = 'lambda'; // lambda is the default
get('no-birthday-date', function() {
console.log(arguments);// Data will be stringified, and returned as string!
// to store/retrieve use JSON.stringify/parse
set('no-birthday-date', new Date(), function(err, data) {
if (err) {
// there is an error
}
if (data === undefined) {
// there is a possible error in JSON.stringify, your value
}
console.log(data); // {id: xx, value: yy}
});
});
```# LICENSE
MIT