home ~ projects ~ socials

Read A JSON File Into An Object In JavaScript

This is a quick and dirty one with no error handling:

const fs = require('fs')

const jsonData = JSON.parse(fs.readFileSync('source.json'))
-- end of line --