0

I'm getting the data from database in Json format.

[
  {
    "name": "Raj",
    "age": 20,
    "fav-color": "blue"
  },
  {
    "name": "Rahul",
    "age": 23,
    "fav-color": "green"
  },
  {
    "name": "Vijay",
    "age": 21,
    "fav-color": "white"
  },
]

I want it to put into the Excel file like,

name |age|fav-color

raj | 20| blue

rahul|23 | green

vijay|21 | white

Rajath
  • 2,611
  • 8
  • 27
  • 43

3 Answers3

0

You can use xlsx npm module. Go here to this package.

Use json to sheet function for generating Excel sheet.

Nasir Kamal
  • 114
  • 1
  • 7
0

You can use json parser to read the json document and exporting it into an excel file in your desired format using poi package.

Pranay
  • 33
  • 9
0

I found ExcelJS library was great to address my problem.

the documentation was done very well,

here is the link to ExcelJS

Rajath
  • 2,611
  • 8
  • 27
  • 43