I have a API with NodeJS
I want to print into a CSV File a Object like this
[
{
"birthday":"1992-01-01",
"email":"[email protected]",
"gender":"male"
},
{
"birthday":"2000-03-23",
"email":"[email protected]",
}
]
And I want this in my CSV File
birthday,email,gender
1992-01-01,[email protected],male
2000-03-23,[email protected]
For print CSV I using
var hiddenElement = document.createElement('a');
hiddenElement.href = 'data:attachment/csv,' + encodeURI(show);
hiddenElement.target = '_blank';
hiddenElement.download = 'result.csv';
hiddenElement.click();
But in the CSV file prints [Object object]
ANy help? Thanks!