# @oscar-bartman/dynamodb-export-csv

> downloads a dynamodb export from s3 as csv

Latest version **0.0.12** (published 2021-10-11) · ISC license · 0 weekly downloads

## Install

```sh
npm install @oscar-bartman/dynamodb-export-csv
pnpm add @oscar-bartman/dynamodb-export-csv
yarn add @oscar-bartman/dynamodb-export-csv
bun add @oscar-bartman/dynamodb-export-csv
```

Provides the command `dynamodb-export-csv`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.12 |
| Published | 2021-10-11 |
| First published | 2021-06-07 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | me@obartman.nl |
| Maintainers | oscar-bartman |
| Keywords | dynamodb, export, csv |

## Links

- npm: https://www.npmjs.com/package/@oscar-bartman/dynamodb-export-csv
- Repository: https://github.com/oscar-bartman/download-dynamodb-export
- Homepage: https://github.com/oscar-bartman/download-dynamodb-export#readme
- Issues: https://github.com/oscar-bartman/download-dynamodb-export/issues
- npm.io page: https://npm.io/package/@oscar-bartman/dynamodb-export-csv

## Dependencies (5)

- [joi](https://npm.io/package/joi.md) ^17.4.2
- [object-path](https://npm.io/package/object-path.md) ^0.11.8
- [csv-stringify](https://npm.io/package/csv-stringify.md) ^5.6.5
- [@aws-sdk/client-s3](https://npm.io/package/@aws-sdk/client-s3.md) ^3.36.0
- [@aws-sdk/util-dynamodb](https://npm.io/package/@aws-sdk/util-dynamodb.md) ^3.36.0

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads

## Recent versions

- 0.0.12 (latest) — 2021-10-11
- 0.0.11 — 2021-09-07
- 0.0.10 — 2021-09-07
- 0.0.9 — 2021-06-21
- 0.0.8 — 2021-06-09
- 0.0.7 — 2021-06-09
- 0.0.6 — 2021-06-08
- 0.0.5 — 2021-06-07
- 0.0.4 — 2021-06-07
- 0.0.2 — 2021-06-07

## README

[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)

# dynamodb-export-csv

Tool that downloads a dynamodb table export stored in s3 as csv files. 

## Usage

Set the following variables through env:

| name                  | description                                        | example        | required |
|-----------------------|----------------------------------------------------|----------------|----------|
| AWS_ACCESS_KEY_ID     |  your aws access key id                            | ...            | yes      |
| AWS_SECRET_ACCESS_KEY | you aws access key                                 | ...            | yes      |
| AWS_REGION            | your aws region                                    | ...            | yes      |
| EXPORT_BUCKET         | name of the bucket that you stored your export in. | arn:...        | yes      |


Download the export as csv. Specify which fields in the data you want under which header name.

```bash
$ export EXPORT_ARN = arn:aws:dynamodb:...
$ dynamodb-export-csv $EXPORT_ARN 'key=id,key=contact.email&header=email'
```

### Outputs: 
0.csv, 1.csv, ..., x.csv, arns.log

### Using filters

You can pass filters by specifying which field you want to filter on and which value it should have. Currently only equals filters are supported:

```bash
$ dynamodb-export-csv $EXPORT_ARN 'key=id,key=contact.email&header=email' 'preferences.favoriteColor' 'BLUE'
```

Specifying which field to filter on is done via [object-path](https://www.npmjs.com/package/object-path) so any of the object query syntax defined therein should work. 

## Development

### Run tests

```
npm t
```

### Debug this code

```bash
$ node --inspect-brk src/index.js
```

---
_Source: https://npm.io/package/@oscar-bartman/dynamodb-export-csv · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
