generateparsetransformstringify

Comprehensive CSV suite combining 4 well tested packages to generate, parse, transform and stringify CSV data.

csv-generate

NPM version Travis build status

Write random and user-defined strings, objects and arrays

csv-parse

NPM version Travis build status

Read CSV strings and buffers and write object and arrays

stream-transform

NPM version Travis build status

Read and write objects and arrays

csv-stringify

NPM version Travis build status

Read object and arrays and write CSV strings

Latest news

CSV version 4 - re-writing and performance

Version 4.0.0 is a complete re-writing of the project focusing on performance. It also comes with new functionalities as well as some cleanup in the option properties and the exported information. The official website is updated and the changelog contains the list of changes for this major release. Learn more!

Quick Example

// Import the package main module
const csv = require('csv')
// Use the module
csv
// Generate 20 records
.generate({
  delimiter: '|',
  length: 20
})
// Parse the records
.pipe(csv.parse({
  delimiter: '|'
}))
// Transform each value into uppercase
.pipe(csv.transform(function(record){
   return record.map(function(value){
     return value.toUpperCase()
   });
}))
// Convert the object into a stream
.pipe(csv.stringify({
  quoted: true
}))
// Print the CSV stream to stdout
.pipe(process.stdout)