diff --git a/lib/jsonlint.js b/lib/jsonlint.js index 598c18c..de881fb 100644 --- a/lib/jsonlint.js +++ b/lib/jsonlint.js @@ -55,6 +55,9 @@ parseError: function parseError(str, hash) { throw new Error(str); }, parse: function parse(input) { + if (input.length && (input[0] === '.' || input[0] === '/')) { + input = require('fs').readFileSync(input).toString(); + } var self = this, stack = [0], vstack = [null], // semantic value stack @@ -429,4 +432,4 @@ exports.main = function commonjsMain(args) { if (typeof module !== 'undefined' && require.main === module) { exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require("system").args); } -} \ No newline at end of file +}