0.6.3 • Published 5 months ago

csv-homie v0.6.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

CSV manager

Maintainability Test Coverage

Friendly manager for CSV.

Example

import { stringify } from 'csv-homie';

const dataArray = [
  ['a', 'b', 'c', 'd'],
  [1, 2, null, 4],
  [5, 6, 7, 8],
];
// with default options - 2th parameter
stringify(dataArray);
// 'a,b,c,d\n1,2,,4\n5,6,7,8'

const dataCollection = [
  { a: 'b', c: 'd', x: undefined, y: '' },
  { a: 'f', c: 0, x: null, y: NaN },
];
// custom options - 2th parameter
stringify(dataCollection, {
  headers: false,
  delimiter: '|',
  isEmptyIfNullable: false,
});
// 'b|d||\nf|0|null|null'

API

2th parameter, default values commented.

interface IOptions {
  headers: boolean; // true
  isEmptyIfNullable: boolean; // true
  delimiter: string; // ','
}

Dev

npm ci
npm test
0.6.3

5 months ago

0.6.2

8 months ago

0.6.1

8 months ago

0.6.0

8 months ago

0.5.0

10 months ago

0.4.0

10 months ago

0.3.0

10 months ago

0.2.0

10 months ago

0.1.0

10 months ago