1

So I'm trying to parse a config.json file from the REPL. The file is: app/config/config.json and I'm running the REPL from app/.

In the REPL if I try to require the file, the REPL doesn't execute, instead waiting for more input:

$ node
> var config = require('./config/config.json');
...

I'm sure it can be done, but I'm not sure what I'm doing wrong: https://stackoverflow.com/a/9804910/1027966

Community
  • 1
  • 1
Nick Desaulniers
  • 2,046
  • 3
  • 25
  • 47

1 Answers1

2

Turns out you cant use Node.js' require to parse JSON if the JSON is invalid. That behavior I witnessed occurs when the parsed JSON is invalid.

Nick Desaulniers
  • 2,046
  • 3
  • 25
  • 47