I'm trying to read my uploaded xlsx find and trying to convert array of array to json key value pair object. so i'm trying below snippet
var fs = uploadedFiles[0].fd;
var xlsxRows = require('xlsx-rows');
var rows = xlsxRows(fs);
var json = JSON.stringify(rows);
console.log(json);
It shows result like array of arrays
[ [ 'Name', 'Age', 'Address' ],
[ 'Raj', '43', 'trichy' ],
[ 'Krthi', '23', 'trichy' ],
[ 'vel', '24', 'trichy' ] ]
but i need to store this as a key vale pair of json object.
[{'Name':'Raj',
'Age':'43',
'Addess':'tichy'},
{'Name':'Krthi',
'Age':'23',
'Addess':'tichy'},
{'Name':'Vel',
'Age':'24',
'Addess':'tichy'}
]
how can i achieve this..can any one help me to fix this issue