3
Get json file
Coder100 (116)

I have successfully created a JSON database. Now how do I access it? I know that require() does not work*. Repl here.
*The error is:
SyntaxError: /home/runner/app/chat.json: Unexpected end of JSON input
at JSON.parse (<anonymous>)
at Object.Module._extensions..json (internal/modules/cjs/loader.js:673:27)
at Module.load (internal/modules/cjs/loader.js:566:32)
at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
at Function.Module._load (internal/modules/cjs/loader.js:498:3)
at Module.require (internal/modules/cjs/loader.js:598:17)
at require (internal/modules/cjs/helpers.js:11:18)
at evalmachine.<anonymous>:17:9
at Script.runInContext (vm.js:74:29)
at Object.runInContext (vm.js:182:6)

You are viewing a single comment. View All