Overview of fast-csv
mainfast-csv is a comprehensive package that combines the capabilities of @fast-csv/format (for generating CSV strings/streams) and @fast-csv/parse (for reading and interpreting CSV data) into a single dependency.repository·main·Indexed 23 days ago
https://github.com/c2fo/fast-csvA high-performance Node.js library for parsing and formatting CSV and other delimited value files. Built with a stream-first architecture to handle large datasets with minimal memory usage, it includes the unified fast-csv package as well as specialized @fast-csv/format and @fast-csv/parse packages. The library is written in TypeScript and provides flexible configuration for delimiters, quote characters, escape characters, and header management.
fast-csv is a comprehensive package that combines the capabilities of @fast-csv/format (for generating CSV strings/streams) and @fast-csv/parse (for reading and interpreting CSV data) into a single dependency.Fast-csv is a Node.js library designed for parsing and formatting CSVs or other delimited value files. Key features include:
@fast-csv/parse package provides functionality to parse CSV data. For detailed usage instructions and getting started guides, refer to the official documentation.Depending on your requirements, you can use the monolithic package or specific sub-packages to reduce your dependency footprint:
fast-csv: The complete package containing all methods and options from both @fast-csv/format and @fast-csv/parse.@fast-csv/parse: Use this if your application only requires CSV parsing capabilities.@fast-csv/format: Use this if your application only requires CSV formatting capabilities.When using fast-csv formatters to create a CSV, you can provide data in three distinct row formats depending on your requirements for headers and column names:
{[string]: any}): Pass an array of objects. The keys of the first object are automatically used as the CSV header names.string[]): Pass an array of arrays. The first inner array is treated as the header row.[string, any][]): Pass an array of arrays where each inner array contains [headerName, value] pairs. This is useful for generating CSVs with duplicate header names.// Object format
[
{ a: "a1", b: "b1", c: "c1" }
];
// Array format
[
['a', 'b', 'c'],
['a1', 'b1', 'c1'],
];
// Key-Value Pair format (for duplicate headers)
[
[
['a', 'a1'],
['a', 'a2'],
['b', 'b1'],
['b', 'b2'],
['c', 'c1'],
['c', 'c2'],
],
];When evaluating fast-csv performance for your use case, note that CSV files containing quoted columns require additional parsing logic compared to non-quoted files.
Use these performance characteristics to estimate processing time based on your expected data format and row counts.
@fast-csv/parse repository contains a collection of JavaScript examples demonstrating various parsing capabilities. You can manage and execute these examples using the following npm scripts:The @fast-csv/format TypeScript examples repository provides demonstrations of CSV formatting capabilities. You can manage the examples using the following npm scripts:
@fast-csv/format package to use the fast-csv formatting capabilities. Refer to the official Install Guide for detailed instructions.@fast-csv/format to transform data into CSV format. For a quick start and detailed usage patterns, consult the Getting Started guide.This repository contains TypeScript examples for the @fast-csv/parse package. You can build the examples, list available ones, or run them individually using the following npm scripts:
npm run buildnpm run listnpm run all-examplesnpm run example -- {example_name}You can build and push the website to the gh-pages branch using the pnpm deploy command. You must provide your GitHub username via the GIT_USER environment variable. If you are using SSH for deployment, set USE_SSH=true.
$ GIT_USER=<Your GitHub username> USE_SSH=true pnpm deploy