Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

javascript based JSON validator (not schema, JSON syntax) in Node.js with connect

I've been using JSONLint online which has been really helpful. I NEED to get this into Node.js though.

Our QA and even I put in so much invalid JSON it's not even funny. The server is using the connect bodyDecoder from connect which currently barfs on invalid input (not sure why the stock bodyDecoder doesn't even catch the error, but oh well). I'll probably want to make my own bodyDecoder, but I can only find a C based JSONLinter.

Is there any library I can use in Node.js to throw helpful errors (such as on http://www.jsonlint.com/) instead of crazy "string not expected" vague errors?

like image 631
V_H Avatar asked Feb 25 '11 01:02

V_H


1 Answers

Pure javascript implementation: https://github.com/zaach/jsonlint, common js compatible to boot.

like image 199
generalhenry Avatar answered Oct 15 '22 03:10

generalhenry