Skip to content

soroushj/node-minimal-csv-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Minimal CSV Formatter

Build Status codecov npm version

Transforms arrays into equivalent CSV strings. Conforms to RFC 4180, with the exception that, instead of CRLF, LF is used as line delimiter.

Usage

const csv = require('minimal-csv-formatter');

let singleRow = csv(['x', 'y']);
// 'x,y\n'

let multipleRows = csv([
  [1, 2],
  [3, 4],
]);
// '1,2\n3,4\n'

let emptyFields = csv([null, undefined]);
// ',\n'

let emptyRows = csv([
  [],
  null,
  undefined,
]);
// ''