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