objects-to-csv
objects-to-csv copied to clipboard
Automatically convert boolean to INT in the CSV
When I try to create a CSV with below data, CSV file was created with value 1 for true and empty for false but I expect to be updated as true or false
[
{
email_address: '[email protected]',
domain: 'gmail.com',
valid_syntax: true,
disposable: false,
webmail: true,
deliverable: true,
catch_all: false,
gibberish: false,
spam: false
},
{
email_address: '[email protected]',
domain: 'gmail.com',
valid_syntax: true,
disposable: false,
webmail: true,
deliverable: true,
catch_all: false,
gibberish: false,
spam: false
},
{
email_address: '[email protected]',
domain: 'gmail.com',
valid_syntax: true,
disposable: false,
webmail: true,
deliverable: true,
catch_all: false,
gibberish: false,
spam: false
}
]
I have a similar issue, have you figured out any solutions?
Update:
Seems to happen from stringify in https://github.com/adaltas/node-csv I had to iterate over every object and manually change true/false to 1 and 0
'true'