JSON Schema Validator

const ajv = ((Ajv) => new Ajv())(require("ajv"));
const configValidator = ajv.compile(require("../validators/config.validator"));
 
// configuration preprocess and checking
const config = {db:{url:"mysql://server/table"}};
if (!configValidator(config)) throw configValidator.errors;

Полезные ссылки