This folder contains end-to-end examples of using this library.
All examples can be run directly without additional setup using node. E.g.:
node ./examples/ex1_1.js
These examples demonstrate the most common, expected usage.
Example 1.1: Basic usage (input, output)
Example 1.2: Replace headers in the output (input, output)
Example 1.3: Chaining multiple transformations (input, output)
Example 1.4: Handling an irregularly-shaped CSV file (input, output)
Example 1.5: Duplicate input rows to the output (input, output)
Example 1.6: Track the status of the CSV processing (input, output)
Example 1.7: Abort a transformation (input, output)
Example 1.8: Read from stdin and write to stdout (input, output)
Example 1.9: Read and write a .csv.gz file (input, output)
Example 1.10: Return a ReadableStream from a transformation (input, output)
These examples demonstrate using the onError option to handle transformations that may throw errors.
Example 2.1: Basic retry strategy (input, output)
Example 2.2: Graceful failure (placeholder value) (input, output)
Example 2.3: Truncated binary exponential backoff (retry with graceful failure) (input, output)
These examples demonstrate using the maxBatchSize and maxConcurrent options to process more than one CSV row at a time.
Example 3.1: Batch processing (multi-row input) using maxBatchSize (input, output)
Example 3.2: Concurrent processing (async) using maxConcurrent (input, output)
These examples demonstrate the extended API.
Example 4.1: Using CSVNormalizer and CSVDenormalizer (input, output)
Example 4.2: Using CSVNormalizer and CSVDenormalizer with CSVTransformer (input, output)
Example 4.3: Using CSVNormalizer.toObject() (input, output)
Example 4.4: Using CSVNormalizer.toFieldMap() (input, output)