Collecting my attempts to improve at tech, art, and life

node-csv

Summary

Suite of CSV processing libraries for Node.js

Components

csv-generate

a flexible generator of CSV string and JavaScript objects

csv-parse

CSV Parse - Usage

a parser converting CSV text into arrays or objects

Multiple APIs:

Interesting Constructor Options

on_record: (record, context): Record? => {}

for row transformation and filtering

info: boolean

if true, parse() produces an object with record and info properties. Sounds like that means it parses the whole thing rather than parts in async.

csv-stringify

CSV Stringify - Usage

columns: array | object

import { stringify } from 'csv-stringify';
import assert from 'assert';

stringify([
  { a: '1', b: '2' }
], {
  columns: [ { key: 'a' }, { key: 'b' } ]
}, function(err, data){
  assert.equal(data, '1,2\n');
});

string-transform

a transformation framework

CSV Transform - Usage


Added to vault 2024-05-06. Updated on 2024-05-06