Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 940 Bytes

README.md

File metadata and controls

32 lines (24 loc) · 940 Bytes

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,
]);
// ''