koles/ya-csv

Improvement: Allow periods in column names for property grouping

Closed this issue · 1 comments

Would be nice if it was possible to group properties into objects, e.g. like this:

reader.setColumnNames([ 'adress.street', 'adress.zip', 'adress.city']);

reader.addListener('data', function(data) {
   console.log(data.adress.street);
   console.log(data.adress.zip);   
   console.log(data.adress.city);
});
koles commented

I would prefer this project to stay focused purely on CSV reading and writing and not to complicate the module with remotely related features like that. It's a cool feature but not CSV specific - why not to create a simple module for converting objects with dots in properties into nested objects?