<commit_before>node-dyno-to-csv
================

A NodeJS Module that exports AWS DynamoDB query results to CSV, presently only stores to S3.
Module will return an S3 signedURL pointing to the saved data.

#### //TODO: 
* Save locally
* Configure AWS to be more flexible
* Alias Column Headers
* Reduce query complexity

Usage
------




```
var dynoToCsv = require('dyno-to-csv'); 
```
##### Configure with AWS Credentials
```
dynoToCsv.configure({
                        credentials: {
                            accessKeyId: 'accessID',
                            secretAccessKey: 'secret',
                            region: 'us-east-1'
                        },
                        storage: {
                            s3: {
                                bucket: 'name-of-bucket-to-save-to' 
                                // If bucket doesn't exist, it will be created with ACL: authenticated-read 
                            }
                        }
                    });
```
                    
#### Or Configure with existing AWS Instance from your application

```
/**
 * This assumes you've already configured AWS somewhere in your app.
 * Now you're just going to use, instances of AWS services.
 */

var dynamoDb = new AWS.DynamoDB();
var s3       = new AWS.S3();

dynoToCsv.configure({
                        dynamodbInstance: dynamoDb,
                        storage: {
                            s3: {
                                instance: s3,
                                bucket: 'name-of-bucket-to-save-to'
                                // If bucket doesn't exist, it will be created with ACL: authenticated-read 
                            }
                        }
                    });
```

```<commit_msg>revised docs<commit_after>node-dyno-to-csv
================

A NodeJS Module that exports AWS DynamoDB query results to CSV, presently only stores to S3.
Module will return an S3 signedURL pointing to the saved data.

#### //TODO: 
* Save locally
* Configure AWS to be more flexible
* Alias Column Headers
* Reduce query complexity

Usage
------




```
var dynoToCsv = require('dyno-to-csv'); 
```
##### Configure with AWS Credentials
```
dynoToCsv.configure({
                        credentials: {
                            accessKeyId: 'accessID',
                            secretAccessKey: 'secret',
                            region: 'us-east-1'
                        },
                        storage: {
                            s3: {
                                bucket: 'name-of-bucket-to-save-to' 
                                // If bucket doesn't exist, it will be created with ACL: authenticated-read 
                            }
                        }
                    });
```
                    
#### Or Configure with existing AWS Instance from your application

```
/**
 * This assumes you've already configured AWS somewhere in your app.
 * Now you're just going to use, instances of AWS services.
 */

var dynamoDb = new AWS.DynamoDB();
var s3       = new AWS.S3();

dynoToCsv.configure({
                        dynamodbInstance: dynamoDb,
                        storage: {
                            s3: {
                                instance: s3,
                                bucket: 'name-of-bucket-to-save-to'
                                // If bucket doesn't exist, it will be created with ACL: authenticated-read 
                            }
                        }
                    });
```

### Just pass in a legitimate DynamoDB query and you're done.
```
{'fraction_non_alphanumeric': 0.09880322849986084, 'fraction_numerical': 0.004453103256331756, 'mean_word_length': 1.1781818181818182, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3536076', 'n_tokens_mistral': 932, 'n_tokens_neox': 850, 'n_words': 273}