7. json2csv - rolling-scopes-school/RS-Short-Track GitHub Wiki

Folder Name Branch Coefficient
json2csv json2csv 0,8

json2csv

Your task is to implement a cli tool that conversts .json file to .csv.

Example of usage

node index.js input.json output.csv

Where input.json has the following structure:

[{
  id: '1',
  name: 'Batman',
  car: 'Batmobile'
}, {
  id: '2',
  car: 'lada',
}]

Result:

id,name,car\n
1,Batman,Batmobile\n
2,,lada\n

Requirements:

  1. You should always take columns from the first object in the list.

Extras:

  1. Usage of custom stream +50%.
  2. Typescript +10%