Read and use JSON data from file in File Directory

All I am trying to do is access the data in the xmltojson.json file.
Is there a way to assign the data to a variable using javascript?

const jsonfile = require('jsonfile')
const file = 'xmltojson.json'
jsonfile.readFile(file, function (err, obj) {
  if (err) console.error(err)
  console.dir(obj)
})

enter image description here