How to use @mapbox/dyno - 3 common examples

To help you get started, we’ve selected a few @mapbox/dyno examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mapbox / dynamodb-replicator / lib / replicate.js View on Github external
params.RequestItems[process.env.ReplicaTable] = Object.keys(allRecords).map(function(key) {
    var change = allRecords[key].pop();
    if (change.eventName === 'INSERT' || change.eventName === 'MODIFY') {
      return {
        PutRequest: { Item: Dyno.deserialize(JSON.stringify(change.dynamodb.NewImage)) }
      };
    } else if (change.eventName === 'REMOVE') {
      return {
        DeleteRequest: { Key: Dyno.deserialize(JSON.stringify(change.dynamodb.Keys)) }
      };
    }
  });
github mapbox / dynamodb-replicator / lib / replicate.js View on Github external
params.RequestItems[process.env.ReplicaTable] = Object.keys(allRecords).map(function(key) {
    var change = allRecords[key].pop();
    if (change.eventName === 'INSERT' || change.eventName === 'MODIFY') {
      return {
        PutRequest: { Item: Dyno.deserialize(JSON.stringify(change.dynamodb.NewImage)) }
      };
    } else if (change.eventName === 'REMOVE') {
      return {
        DeleteRequest: { Key: Dyno.deserialize(JSON.stringify(change.dynamodb.Keys)) }
      };
    }
  });
github nasa / cumulus / packages / api / bin / backup.js View on Github external
stringify._transform = function _transform(record, enc, callback) {
    const line = Dyno.serialize(record);

    setImmediate(() => {
      stringify.push(`${line}\n`);
      count += 1;
      callback();
    });
  };

@mapbox/dyno

Simple DynamoDB client

MIT
Latest version published 2 years ago

Package Health Score

57 / 100
Full package analysis

Popular @mapbox/dyno functions