I have saved a JSON file in my local system and created a JavaScript file in order to read the JSON file and print data out. Here is the JSON file:
{"res
When in Node.js or when using require.js in the browser, you can simply do:
let json = require('/Users/Documents/workspace/test.json'); console.log(json, 'the json obj');
Do note: the file is loaded once, subsequent calls will use the cache.