🌐
C2fo
c2fo.github.io › fast-csv › docs › parsing › examples
Examples | Fast-CSV
JavaScript Examples Source · TypeScript · JavaScript · Output · Copy · import { parse } from '@fast-csv/parse'; const stream = parse({ headers: true }) .on('error', error => console.error(error)) .on('data', row => console.log(row)) .on('end', (rowCount: number) => console.log(`Parsed ${rowCount} rows`)); stream.write('header1,header2\n'); stream.write('col1,col2'); stream.end(); You can provide a delimiter option to change the delimiter from a , character.
🌐
Snyk
snyk.io › advisor › fast-csv › fast-csv code examples
Top 5 fast-csv Code Examples | Snyk
const fs = require('fs'); const csv = require('fast-csv'); require('sepia'); /* eslint import/no-extraneous-dependencies: [0] */ require('dotenv').config(); const twitter = require('../common/lib/twitter'); // const { getRank } = require('../common/lib/similarweb.js'); const filename = './common/data/dapps.csv'; const apps = []; csv .fromPath(filename, { headers: true, }) .on('data', async (data) => { apps.push(data); }) .on('end', async () => { await twitter.fetchMentions(apps); const writeStream = fs.createWriteStream('./common/data/dapps-ranked.csv'); csv.write(apps, { headers: true }).pipe(writeStream); console.log('done'); });
🌐
GitHub
github.com › C2FO › fast-csv
GitHub - C2FO/fast-csv: CSV parser and formatter for node · GitHub
Fast-csv is library for parsing and formatting CSVs or any other delimited value file in node.
Starred by 1.8K users
Forked by 216 users
Languages   TypeScript 99.0% | JavaScript 1.0%
🌐
DEV Community
dev.to › chriscmuir › fast-csv-for-csv-files-21a1
fast-csv for CSV files - DEV Community
March 6, 2021 - In looking at the feature set, fast-csv is comprised of 'parse' and 'format' routines for ingesting and transforming CSV files. It also supports streams for fast processing of large files.
🌐
npm
npmjs.com › package › fast-csv
fast-csv - npm
May 6, 2026 - CSV parser and writer. Latest version: 5.0.7, last published: 2 months ago. Start using fast-csv in your project by running `npm i fast-csv`. There are 958 other projects in the npm registry using fast-csv.
      » npm install fast-csv
    
Published   May 06, 2026
Version   5.0.7
🌐
C2fo
c2fo.github.io › fast-csv › docs › introduction › example
Quick Examples | Fast-CSV
TypeScript Source · Javascript Source · TypeScript · JavaScript · Output · Copy · import * as csv from 'fast-csv'; const csvStream = csv.format({ headers: true }); csvStream.pipe(process.stdout).on('end', () => process.exit()); csvStream.write({ header1: 'row1-col1', header2: 'row1-col2' ...
🌐
Tabnine
tabnine.com › home › code library
Code Library - Tabnine
July 25, 2024 - Get the answers and suggestions you need from our AI code assistant. Get started in minutes with a free 90 day trial of Tabnine Pro.
🌐
Geshan
geshan.com.np › blog › 2021 › 11 › nodejs-read-write-csv
How to read and write CSV files with Node.js
November 30, 2021 - To write a CSV file using Fast CSV we will use the format package included in the Fast CSV npm module. Below is a quick example where we write 80K random rows to a test CSV file which could also have been data pulled in from a database:
🌐
Snyk
snyk.io › advisor › fast-csv › functions › fast-csv.format
How to use the fast-csv.format function in fast-csv | Snyk
return new Promise((resolve, reject) => { options = options || {}; // const encoding = options.encoding || 'utf8'; // const separator = options.separator || ','; // const quoteChar = options.quoteChar || '\''; const worksheet = this.workbook.getWorksheet(options.sheetName || options.sheetId); const csvStream = fastCsv.format(options); stream.on('finish', () => { resolve(); }); csvStream.on('error', reject); csvStream.pipe(stream); const {dateFormat, dateUTC} = options; const map = options.map || (value => { if (value) { if (value.text || value.hyperlink) { return value.hyperlink || value.text || ''; } if (value.formula || value.result) { return value.result || '';
Find elsewhere
🌐
FastCSV
fastcsv.org › guides › examples
Overview | FastCSV
This section provides a variety of examples to help you get started with FastCSV.
🌐
FastCSV
fastcsv.org › guides › basic
Basic Tutorial | FastCSV
This section covers the most basic usage of FastCSV. It provides examples for reading and writing CSV data.
🌐
C2fo
c2fo.io › fast-csv › docs › formatting › examples
Examples | Fast-CSV
The writeHeaders option can be useful when appending to a csv to prevent writing headers twice. See the append example · If writeHeaders is set to false, headers is set to true, and your rows are arrays, the first row will not be written. In this example the auto discovered headers are not written. ... In this example the headers are provided to specify order of columns but they are not written. ... Sometimes you may need to quote columns in a certain ways in order to meet certain requirements. fast...
🌐
CodeSandbox
codesandbox.io › examples › package › fast-csv
fast-csv examples - CodeSandbox
Use this online fast-csv playground to view and fork fast-csv example apps and templates on CodeSandbox.
🌐
Npmdoc
npmdoc.github.io › node-npmdoc-fast-csv › build › apidoc.html
CSV parser and writer
... * `data`: Emitted with the object or `stringified` version if the `objectMode` is set to `false`. **`([options])` or `.parse(options)`** If you use `fast-csv` as a function it returns a transform stream that can be piped into. ```javascript var stream = fs.createReadStream("my.csv"); var csvStream = csv() .on("data", function(data){ console.log(data); }) .on("end", function(){ console.log("done"); ... description and source-code · function createWriteStream(options) { return new CsvTransformStream(options); } example usage ·
🌐
GitHub
gist.github.com › basperheim › 1a230cdbcbc5dd54d9145e59d4f1df72
Create a CSV file using NodeJS and fast-csv · GitHub
Another example that passes an an nested array of row arrays with set headers: #!/usr/bin/env node 'use strict'; const fs = require('fs'); const path = require('path'); const csv = require('fast-csv'); /** * Writes data stored in an object literal to a CSV file path **/ const createCsv = (data, filename) => { const csvFile = path.resolve(__dirname, filename); // pass the array of headers to format() method const csvStream = csv.format({ headers: data.headers }); // loop over nested row arrays const arr = data.rows; for (let i = 0; i<arr.length; i++) { let row = arr[i]; csvStream.write( row );
🌐
C2fo
c2fo.github.io › fast-csv
Fast-CSV | Fast-CSV
CSV Parser and Formatter · Get Started · Built on top of the Node.js Stream API, so you can work with APIs you are familiar with. Out of the box formatting and parsing of any delimiter separated file.
🌐
LogRocket
blog.logrocket.com › home › a complete guide to csv files in node.js
A complete guide to CSV files in Node.js - LogRocket Blog
August 14, 2024 - You can use @fast-csv/format and @fast-csv/parse for formatting and parsing CSV datasets, respectively. The example below illustrates how to read a CSV file and parse it to JSON using Fast-CSV:
🌐
FastCSV
fastcsv.org › guides › quickstart
Quick Start Guide | FastCSV
To iterate over CSV records in a file and print them to the console, use the following code snippet: ... Both methods (ofCsvRecord and ofNamedCsvRecord) are overloaded for other input sources like String, Reader and InputStream as well. Using the more generic build method, you can also make use of the Callback mechanism to process the records. See Custom callback handler example for more information.
🌐
Snyk
snyk.io › advisor › fast-csv › functions › fast-csv.parse
How to use the fast-csv.parse function in fast-csv | Snyk
December 28, 2022 - const datumNumber = Number(datum); if (!Number.isNaN(datumNumber) && datumNumber !== Infinity) { return datumNumber; } const dt = dayjs(datum, dateFormats, true); if (dt.isValid()) { return new Date(dt.valueOf()); } const special = SpecialValues[datum]; if (special !== undefined) { return special; } return datum; }; const csvStream = fastCsv.parse(options) .on('data', data => { worksheet.addRow(data.map(map)); }) .on('end', () => { csvStream.emit('worksheet', worksheet); }); return csvStream; }
🌐
C2fo
c2fo.github.io › fast-csv › docs › introduction › getting-started
Getting Started | Fast-CSV
Fast-csv is library for parsing and formatting CSVs or any other delimited value file in node.