If i require a file as
require('file.json');
how do i go about checking if the JSON is valid? try catch? I'm using bluebird promises so right now its just returning
Promise.resolve(require('file.json'));
and bluebird catches if file is not found but i also need to check the JSONs sanity. I understand you can just pass JSON.parse to a thenable if file itself is returned as a string by FS or whatever but i dont mind caching and requiring would be faster