{"_id":"dynamodb-touch","_rev":"191-5ce6d3c64df82dcce018c14b3255b83e","name":"dynamodb-touch","description":"[![Build Status](https://travis-ci.org/mapbox/dynamodb-touch.svg?branch=master)](https://travis-ci.org/mapbox/dynamodb-touch)","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"dynamodb-touch","version":"0.0.1","description":"[![Build Status](https://travis-ci.org/mapbox/dynamodb-touch.svg?branch=master)](https://travis-ci.org/mapbox/dynamodb-touch)","main":"index.js","scripts":{"pretest":"eslint index.js test/*.js","test":"AWS_ACCESS_KEY_ID=fake AWS_SECRET_ACCESS_KEY=fake nyc tape test/*.test.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/dynamodb-touch.git"},"author":{"name":"Mapbox"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/dynamodb-touch/issues"},"homepage":"https://github.com/mapbox/dynamodb-touch#readme","devDependencies":{"dynamodb-test":"^0.2.0","eslint":"^1.10.3","kinesis-test":"^1.0.0","nyc":"^5.0.0","tape":"^4.2.2"},"dependencies":{"aws-sdk":"^2.2.22","dyno":"^1.0.1"},"gitHead":"b4a97e82a1fea292523265c039362f0ba517c5ca","_id":"dynamodb-touch@0.0.1","_shasum":"f7261fe64ed400cccbccabd3a64f283b717ebfa6","_from":".","_npmVersion":"2.14.7","_nodeVersion":"0.10.41","_npmUser":{"name":"rclark","email":"ryan.clark.j@gmail.com"},"maintainers":[{"name":"rclark","email":"ryan.clark.j@gmail.com"}],"dist":{"shasum":"f7261fe64ed400cccbccabd3a64f283b717ebfa6","tarball":"https://registry.npmjs.org/dynamodb-touch/-/dynamodb-touch-0.0.1.tgz","integrity":"sha512-rAKQCRoSAXPDhzfmnGR4vz3owvVFzyx2jZtET5ca06ml0NEEOeqfByjFfgCAEjYkWu6vzlrZHsBdFv04j5FiNg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxG8wzZgmxNN1PxfFHoc3ko1fCVbycJkC5lc15JdrpCAiEAzJyNM8jNi/i9DVYlbYvlnRBAWHYeRvSWgFYuDrrj3P4="}]},"directories":{}},"0.1.0":{"name":"dynamodb-touch","version":"0.1.0","description":"[![Build Status](https://travis-ci.org/mapbox/dynamodb-touch.svg?branch=master)](https://travis-ci.org/mapbox/dynamodb-touch)","main":"index.js","scripts":{"pretest":"eslint index.js test/*.js","test":"AWS_ACCESS_KEY_ID=fake AWS_SECRET_ACCESS_KEY=fake nyc tape test/*.test.js","coverage":"AWS_ACCESS_KEY_ID=fake AWS_SECRET_ACCESS_KEY=fake nyc --reporter=html tape test/*.test.js && open coverage/index.html"},"repository":{"type":"git","url":"git+https://github.com/mapbox/dynamodb-touch.git"},"author":{"name":"Mapbox"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/dynamodb-touch/issues"},"homepage":"https://github.com/mapbox/dynamodb-touch#readme","devDependencies":{"dynamodb-test":"^0.2.0","eslint":"^1.10.3","kinesis-test":"^1.0.0","nyc":"^5.0.0","tape":"^4.2.2"},"dependencies":{"aws-sdk":"^2.2.22","dyno":"^1.0.1","locking":"^2.0.2"},"gitHead":"a10d8e21440184065b4ecd599c6bd9ea21569ce0","_id":"dynamodb-touch@0.1.0","_shasum":"7708a0e483f39e3ac72daf60983f9d8dcb1a749c","_from":".","_npmVersion":"2.14.7","_nodeVersion":"0.10.41","_npmUser":{"name":"rclark","email":"ryan.clark.j@gmail.com"},"dist":{"shasum":"7708a0e483f39e3ac72daf60983f9d8dcb1a749c","tarball":"https://registry.npmjs.org/dynamodb-touch/-/dynamodb-touch-0.1.0.tgz","integrity":"sha512-ozd/BEMlKGZCqcID8c4JOkroVTyHXr1K0Ibp9u1B0MZUNcf6DOxeVXqM9OMtKmYarsGhf2VK5Em2jGDQxe4OTA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCMl0yj/KpynkshxoTruvZNSgxk+iwKtLMfEnDZlqbK+gIhAMYWQ10yClMunvIU3of8wF+ERsUUgl2B/Ex6EcZyOeAC"}]},"maintainers":[{"name":"1ec5","email":"mxn@1ec5.org"},{"name":"aaronlidman","email":"aaronlidman@gmail.com"},{"name":"ajashton","email":"aj.ashton@gmail.com"},{"name":"alulsh","email":"ulsh@mapbox.com"},{"name":"ansis","email":"ansis.brammanis@gmail.com"},{"name":"apendleton","email":"andrew@mapbox.com"},{"name":"bergwerkgis","email":"wb@bergwerk-gis.at"},{"name":"bhousel","email":"bryan@mapbox.com"},{"name":"bsudekum","email":"bobby@mapbox.com"},{"name":"camilleanne","email":"camille@mapbox.com"},{"name":"dnomadb","email":"damon@mapbox.com"},{"name":"emilymcafee","email":"emily@mapbox.com"},{"name":"flippmoke","email":"flippmoke@gmail.com"},{"name":"freenerd","email":"spam@freenerd.de"},{"name":"gretacb","email":"carol@mapbox.com"},{"name":"ian29","email":"ian.villeda@gmail.com"},{"name":"ianshward","email":"ian@mapbox.com"},{"name":"ingalls","email":"nicholas.ingalls@gmail.com"},{"name":"jfirebaugh","email":"john.firebaugh@gmail.com"},{"name":"jrpruit1","email":"jake@jakepruitt.com"},{"name":"karenzshea","email":"karen@mapbox.com"},{"name":"kelvinabrokwa","email":"kelvinabrokwa@gmail.com"},{"name":"lbud","email":"lauren@mapbox.com"},{"name":"lucaswoj","email":"lucas@lucaswoj.com"},{"name":"lxbarth","email":"alex@mapbox.com"},{"name":"lyzidiamond","email":"lyzi@mapbox.com"},{"name":"mapsam","email":"matthews.sam@gmail.com"},{"name":"mateov","email":"matt@mapbox.com"},{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},{"name":"miccolis","email":"jeff@miccolis.net"},{"name":"mikemorris","email":"michael.patrick.morris@gmail.com"},{"name":"morganherlocker","email":"morgan.herlocker@gmail.com"},{"name":"mourner","email":"agafonkin@gmail.com"},{"name":"mtirwin","email":"irwin@mapbox.com"},{"name":"nickidlugash","email":"nicki@mapbox.com"},{"name":"planemad","email":"arun.planemad@gmail.com"},{"name":"rclark","email":"ryan.clark.j@gmail.com"},{"name":"samanbb","email":"saman@mapbox.com"},{"name":"sbma44","email":"tlee@mapbox.com"},{"name":"scothis","email":"scothis@gmail.com"},{"name":"sgillies","email":"sean@mapbox.com"},{"name":"themarex","email":"patrick@mapbox.com"},{"name":"tristen","email":"tristen.brown@gmail.com"}],"directories":{}}},"readme":"# dynamodb-touch\n\n[![Build Status](https://travis-ci.org/mapbox/dynamodb-touch.svg?branch=master)](https://travis-ci.org/mapbox/dynamodb-touch)\n\nSimulated DynamoDB Stream events based on the contents of a DynamoDB table.\n\n## What it does\n\nPerforms either a GetItem, Query, or Scan operation on a DynamoDB table, then\npasses each resulting record into a Kinesis stream in a wrapper identical to\nwhat would be provided by a DynamoDB stream `INSERT` event.\n\n## How to use it\n\nYou must provide your own configured [Dyno](https://github.com/mapbox/dyno) and\nKinesis clients. The Kinesis client must be pre-configured to provide the stream\nname with each request.\n\n```js\nvar touch = require('dynamodb-touch');\nvar AWS = require('aws-sdk');\nvar Dyno = require('dyno');\n\nvar clients = {\n  dyno: Dyno({\n    table: 'my-dynamodb-table',\n    region: 'us-east-1'\n  }),\n  kinesis: new AWS.Kinesis({\n    region: 'us-east-1',\n    params: { StreamName: 'my-kinesis-stream' }\n  })\n};\n\n// send one event for a dynamodb record with the provided key\ntouch.one({ id: 'some-record' }, clients, function(err) {\n  if (err) throw err;\n});\n\n// query dynmodb, sending events for each result\ntouch.some({\n  KeyConditions: {\n    id: {\n      ComparisonOperator: 'EQ',\n      AttributeValueList: ['some-record']\n    }\n  }\n}, clients, function(err) {\n  if (err) throw err;\n});\n\n// scan every record in dynamodb, sending events for each result\ntouch.every(clients, function(err) {\n  if (err) throw err;\n});\n\n// send one event for a feature that has already been fetched\nvar item = { id: 'record-id', data: 'record-data' };\ntouch.thisOne(item, clients, function(err) {\n  if (err) throw err;\n});\n```\n\n## What events in Kinesis will look like\n\nA Kinesis event will contain a `Data` property. For dynamodb-touch events, this\nwill be a base64-encoded JSON string which mimics a DynamoDB Stream event.\n\n```js\nkinesis.getRecords({ ShardIterator: 'xyz' }, function(err, data) {\n  var record = data.Records[0];\n  var dynamodbEvent = JSON.parse((new Buffer(record.Data, 'base64')).toString());\n  console.log(JSON.stringify(dynamodbEvent, null, 2));\n});\n```\n\n... will console.log:\n\n```json\n{\n  \"eventId\": \"0\",\n  \"eventVersion\": \"1.0\",\n  \"awsRegion\": \"us-east-1\",\n  \"eventSourceARN\": \"arn:aws:dynamodb:us-east-1:000000000000:table/my-dynamodb-table/dynamodb-touch\",\n  \"eventSource\": \"dynamodb-touch\",\n  \"eventName\": \"INSERT\",\n  \"dynamodb\": {\n    \"Keys\": {\n      \"id\": { \"S\": \"my-record\" }\n    },\n    \"NewImage\": {\n      \"id\": { \"S\": \"my-record\" },\n      \"data\": { \"B\": \"aGVsbG8geW91\" }\n    },\n    \"StreamViewType\": \"NEW_IMAGE\",\n    \"SequenceNumber\": \"0\",\n    \"SizeBytes\": 52\n  }\n}\n```\n","maintainers":[{"email":"accounts@mapbox.com","name":"mapbox-admin"}],"time":{"modified":"2022-09-20T15:17:08.807Z","created":"2016-01-15T21:01:44.763Z","0.0.1":"2016-01-15T21:01:44.763Z","0.1.0":"2016-01-16T18:19:41.490Z"},"homepage":"https://github.com/mapbox/dynamodb-touch#readme","repository":{"type":"git","url":"git+https://github.com/mapbox/dynamodb-touch.git"},"author":{"name":"Mapbox"},"bugs":{"url":"https://github.com/mapbox/dynamodb-touch/issues"},"license":"ISC","readmeFilename":"readme.md"}