🌐
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%
🌐
C2fo
c2fo.github.io › fast-csv › docs › introduction › example
Quick Examples | Fast-CSV
Quick examples of parsing and formatting. 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' }); csvStream.write({ header1: 'row2-col1', header2: 'row2-col2' }); csvStream.write({ header1: 'row3-col1', header2: 'row3-col2' }); csvStream.write({ header1: 'row4-col1', header2: 'row4-col2' }); csvStream.write({ header1: 'row5-col1', header2: 'row5-col2' }); csvStream.end(); TypeScript ·
🌐
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.
🌐
GitHub
github.com › C2FO › fast-csv › tree › main › examples
fast-csv/examples at main · C2FO/fast-csv
CSV parser and formatter for node. Contribute to C2FO/fast-csv development by creating an account on GitHub.
Author   C2FO
🌐
FastCSV
fastcsv.org › guides › examples
Overview | FastCSV
You find all source code examples in the FastCSV GitHub repository.
🌐
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:
🌐
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
Find elsewhere
🌐
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 );
🌐
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.
🌐
Snyk
snyk.io › advisor › fast-csv › functions › fast-csv.format
How to use the fast-csv.format function in fast-csv | Snyk
const fs = require('fs'); const path = require('path'); const csv = require('fast-csv'); const User = require('./models/user'); fs.createReadStream(path.resolve(__dirname, 'assets', 'snake_case_users.csv')) .pipe(csv.parse({ headers: true })) // pipe the parsed input into a csv formatter .pipe(csv.format({ headers: true })) // Using the transform function from the formatting stream .transform((row, next) => { User.findById(row.id, (err, user) => { if (err) { return next(err); } return next(null, { id: row.id, firstName: row.first_name, lastName: row.last_name, address: row.address, // properties from user isVerified: user.isVerified, hasLoggedIn: user.hasLoggedIn, age: user.age, });
🌐
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.
🌐
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.
🌐
CodeSandbox
codesandbox.io › examples › package › @fast-csv › parse
fast-csv/parse examples
Use this online @fast-csv/parse playground to view and fork @fast-csv/parse example apps and templates on CodeSandbox.
🌐
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 - bhushankumarl / amazon-mws / examples / javaScript / sample / getReportAsReadableStram.js View on Github · } if (rows.length >= 5000 || (end && rows.length)) { sendToDB(rows.splice(0, 0), callback); rows = []; } } function sendToDB(data, callback) { // Send your data to the db console.log(data.length); callback(); } var decodeStream = iconv.decodeStream('ISO-8859-1'); response.pipe(decodeStream); var csvStream = csv.parse({ delimiter: '\t', headers: true, discardUnmappedColumns: true, ignoreEmpty: true, trim: true }); decodeStream.pipe(csvStream); csvStream.transform(function (data, cb) { processRowsInBatches(data, false, cb); }); csvStream .on('error', function (error) { console.error(error); }) .on('finish', function () { console.log('Finished proccessing stream'); // Call processRowsInBatches to proccess remaining rows processRowsInBatches(undefined, true, function () {
🌐
GitHub
github.com › C2FO › fast-csv › blob › main › documentation › docs › formatting › examples.mdx
fast-csv/documentation/docs/formatting/examples.mdx at main · C2FO/fast-csv
In this example a custom set of headers is provided for rows that are arrays. <Tabs defaultValue="ts" values={[ { label: 'TypeScript', value: 'ts', }, { label: 'JavaScript', value: 'js', }, { label: 'Output', value: 'output', }, ] }> import { format } from '@fast-csv/format'; const csvStream = format({ headers: ['header1', 'header2'] }); csvStream.pipe(process.stdout).on('end', () => process.exit()); csvStream.write(['value1a', 'value1b']); csvStream.write(['value2a', 'value2b']); csvStream.write(['value3a', 'value3b']); csvStream.write(['value4a', 'value4b']); csvStream.end();
Author   C2FO
🌐
GitHub
github.com › C2FO › fast-csv › blob › main › examples › parsing-js › README.md
fast-csv/examples/parsing-js/README.md at main · C2FO/fast-csv
@fast-csv/parse javascript parsing examples. To run all examples · npm run all-examples · To see a list of all available examples · npm run list · To run a specific example ·
Author   C2FO
🌐
Openbase
openbase.com › js › fast-csv
fast-csv: Docs, Community, Tutorials, Reviews | Openbase
December 4, 2020 - fast-csv documentation and community, including tutorials, reviews, alternatives, and more
🌐
C2fo
c2fo.github.io › fast-csv › docs › introduction › getting-started
Getting Started | Fast-CSV
Examples · Migration Guides · v2.x-to-v3.x · Fast-csv is library for parsing and formatting CSVs or any other delimited value file in node. CSV Formatting · CSV Parsing · Built using typescript. Flexible formatting and parsing options, to fit almost any scenario.