const fs = require("fs"); var posts = []; fs.readFile('./data/posts.json', 'utf8', (err, data) => { if (err) throw err; posts = JSON.parse(data); });