Skip to content

Instantly share code, notes, and snippets.

@cuter44
Last active March 17, 2017 10:17
Show Gist options
  • Save cuter44/d6c2ffa15bbc26b5b4832f0cc8f5db2b to your computer and use it in GitHub Desktop.
Save cuter44/d6c2ffa15bbc26b5b4832f0cc8f5db2b to your computer and use it in GitHub Desktop.
const fl = [
'./src/main/resources/acl.json',
'./src/main/resources/gru.json',
'./tmp/acl.json',
'./tmp/acl-live.json'
// append file to check here
];
const fs = require('fs');
const color = require('cli-color');
const jsonlint = require('jsonlint');
for (var fn of fl)
{
try
{
jsonlint.parse(fs.readFileSync(fn, "utf8"));
console.log(color.green("[OK]\t")+fn);
}
catch (ex)
{
console.log(color.red("[ERROR]\t")+fn+"\n\t"+ex);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment