Socket
Socket
Sign inDemoInstall

dynoga

Package Overview
Dependencies
41
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dynoga

**Dynoga** is a light library for use DynamoDB with javascript objects


Version published
Weekly downloads
7
increased by250%
Maintainers
1
Install size
58.1 MB
Created
Weekly downloads
 

Readme

Source

Dynoga

NPM

Disclaimer

Dynoga is a lightweight library to use DynamoDB with JavaScript objects.

We use CRUD naming for easy matching with Backbone.ioBind

How to use

Initialize

Dynoga = require "dynoga"

db = new Dynoga
  endpoint: config.dynamoDB.endpoint
  accessKeyId: config.dynamoDB.accessKeyId
  secretAccessKey: config.dynamoDB.secretAccessKey
  region: config.dynamoDB.region

Create an item

db.create "mytable", item, (err, model) ->
  if err then console.log err
  console.log model

Read an item

keys: Key/value object, a hash is mandatory

db.read "mytable", keys, (err, model) ->
  if err then console.log err
  console.log model

Update an item

item: Key/value object, a hash and range are mandatory

Dynoga automatically find primary keys for update the good item.

db.update "mytable", item, (err, model) ->
  if err then console.log err
  console.log model

Delete an item

item: Key/value object, a hash and range are mandatory

Dynoga automatically find primary keys for delete the good item.

db.delete "mytable", item, (err, model) ->
  if err then console.log err
  console.log model

Running Tests

Put in your environment

export METIDIA_ACCESS_KEY_ID=YOURACCESKEYID
export METIDIA_SECRET_ACCESS_KEY=YOURSECRETACCESSKEY

Run a local dynomadb instance

$ java -Djava.library.path=. -jar DynamoDBLocal.jar

cf: DynamoDB Local for Desktop Development

Run tests

npm test Execute units tests

npm run watch-test Execute units tests with watch files for changes

Warning

For a natural sorting for READ operations, Dynoga use an internal _createTimeStamp attribute. Please don't use it if you don't want surprise ;)

Keywords

FAQs

Last updated on 08 Apr 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc