I have an array of objects similar to the below:
const data = [
{ "name": "Amsterdam", value: 40000, uniqueId: '2432g53122141' },
{ "name": "New York", value: 200000, uniqueId: '24322141' },
{ "name": "Mumbai", value: 5000, uniqueId: '9999' }
]
I want to convert it to the below format using tab separated strings with proper formatting/alignment similar to below.
This is needed to be a string as I will be sending this data to a third party form which accepts only text and no HTML data.
Name Value UniqueId
Amsterdam 40000 243253122141
New York 200000 24322141
Mumbai 5000 9999
How can I achieve the same with proper formatting so that there is no alignment issues as the length of data for each property can vary as can be seen above. Is there any package available?