0.1.1 • Published 10 years ago
json-check v0.1.1
json-check
json-check file1.json file2.json ... checks that each file contains a single JSON-formatted entity.
- Every file will be parsed with
JSON.parse(). If that throws an error, the script will immediately print the filename tostdout.- If the
-v/--verboseflag is provided, it will print theJSON.parse()error message tostderr. - The script will continue to check all the other files.
- If the
- If
JSON.parse()throws an error for any of the files, the process will exit with code 65 (EX_DATAERR) when it has finished checking all files. Otherwise, it will exit with code 0 (EX_OK). - If any of the files cannot be read, the script will immediately throw an error and exit with code 66 (
EX_NOINPUT).
License
Copyright 2015 Christopher Brown. MIT Licensed.