I have managed to convert CSV data to JSON using the csvtojson npm package and successfully display it in the console.
csvtojson()
.fromFile(csvFilePath)
.then(jsonObj => {
console.log(jsonObj);
})
[
{
id: '1',
title: 'Fjallraven - Foldsack No. 1 Backpack, Fits 15 Laptops',
price: '109.95',
description: 'Your perfect pack for everyday use and walks in the forest. Stash your laptop (up to 15 inches) in the padded sleeve, your everyday',
category: 'men clothing',
image: 'https://fakestoreapi.com/img/81fPKd-2AYL._AC_SL1500_.jpg'
}
]
Now I want to console log only the id and title field, how should I go about it? Many thanks in advance and greatly appreciate any helps. Thanks again