level-dynamodb
level-dynamodb ==============
Last updated 6 years ago by dguttman .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install level-dynamodb 
SYNC missed versions from official npm registry.

level-dynamodb

A convenience package bundling LevelUP and DyamoDOWN

This is a convenience package that bundles the current release of LevelUP and DynamoDOWN and exposes LevelUP on its export.

Use this package to avoid having to explicitly install DynamoDOWN when you want to use DynamoDOWN with LevelUP.


var level = require('level-dynamodb')

// 1) Create our database, supply location and options.
//    This will create or open the underlying LevelDB store.
var db = level('some-table-name', {
  // level options
  valueEncoding: 'json',
  // required DynamoDB options
  dynamo: {
    region: 'us-east-1',
    secretAccessKey: 'abc',
    accessKeyId: '123',
    // optional desired throughput (first run/create only)
    ProvisionedThroughput: {
      ReadCapacityUnits: 1,
      WriteCapacityUnits: 1
    }
  }
})

// 2) put a key & value
db.put('name', 'Level', function (err) {
  if (err) return console.log('Ooops!', err) // some kind of I/O error

  // 3) fetch by key
  db.get('name', function (err, value) {
    if (err) return console.log('Ooops!', err) // likely the key was not found

    // ta da!
    console.log('name=' + value)
  })
})

See LevelUP and DyamoDOWN for more details.

License

MIT

Current Tags

  • 0.0.1                                ...           latest (6 years ago)

1 Versions

  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |