Here is a example to filter the keys of json data.
// require fs libraryconstfs=require('fs');// read json from fileconstfileContent=fs.readFileSync('input.json','utf8');// parse as arrayconstjsonArray=JSON.parse(fileContent);// for each value from json array// pick the id column onlyvarresult=[]jsonArray.forEach(value=>{varobj={}obj['id']=value['id'];result.push(obj);});// convert to json string and write to filefs.writeFileSync('output.json',JSON.stringify(result));