I have a API with NodeJS
I want to print into a CSV File a Object like this
[
{
"birthday":"1992-01-01",
"email":"test@mail.com",
"gender":"male"
},
{
"birthday":"2000-03-23",
"email":"test2@mail.com",
}
]
And I want this in my CSV File
birthday,email,gender
1992-01-01,test@gmail.com,male
2000-03-23,test2@mail.com
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!