Summary
Suite of CSV processing libraries for Node.js
Components
csv-generate
a flexible generator of CSV string and JavaScript objects
csv-parse
a parser converting CSV text into arrays or objects
Multiple APIs:
- Stream API
- Callback API
- Stream + callback API
- Sync API
- Async iterator API
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
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
Backlinks
Added to vault 2024-05-06. Updated on 2024-05-06