koles/ya-csv

Support writing object records

Opened this issue · 0 comments

Hi,

The CsvWriter object should support two additional options:
a) an option that defines the column names of objects to be written with writeRecord (e.g. { columnNames : ["name", "age"] } ).
b) an option that defines whether the column names should be written to the output as a first line (e.g. {columnsAsHeader : true} ).

This way, CsvWrite could be used to write objects (dictionaries) instead of just arrays.