DynamoDB export command-line script.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Command-line utility to export a DynamoDB database to a list of JSON documents.


The dynamodbexport package is installed via npm:

npm install -g dynamodbexport

You may need to precede the above command with sudo, depending on your Node.js installation.


The dynamodbexport command-line tool assumes a locally installed copy of DynamoDB by default. If you want to use hosted DynamoDB, then supply your AWS key and secret key as environment variables:


The AWS Region must also be set with the -r or --region command-line parameter.

Command-line Usage

Use the dynamodbexport tool to export an entire DynamoDB table. The table is specified with the -t or --table command-line parameter:

$ dynamodbexport -t mytable -r us-east-1
Export complete { iterations: 1, records: 3, time: 0.145 }

The data can be directed to a text file:

$ dynamodbexport -t mytable > mydata.txt
Export complete { iterations: 1, records: 3, time: 0.145 }

or piped elsewhere e.g. to couchimport to import the data into Apache CouchDB:

$ dynamodbexport --table mytable | couchimport --db mycouchtable --type jsonl
Export complete { iterations: 1, records: 3, time: 0.145 }
couchimport writecomplete { total: 3, totalfailed: 0 } +20ms
couchimport Import complete

Programmatic Usage

You can also use the library within your own code:

var dynamodbexport = require('dynamodbexport');
var region = 'us-east-1';
var table = 'mytable';
dynamodbexport.tableExport(region, table, function(err, data) {
  if (err) {
    console.error('ERROR', err)
  } else {
    console.error('Export complete', data)

Options Reference

Command-line parameters

  • -t or --table - the table to export (required)
  • -r or --region - the AWS region to communicate with (for remote DynamoDB exports only)

Environment variables

  • AWS_ACCESS_KEY_ID - the AWS key
  • AWS_SECRET_ACCESS_KEY - the AWS secret

N.B The role attached to the credentials you supply must have DynamoDB.Scan privileges.