npm i bug-jsonv
var validator = require('bug-jsonv')
var JSONdata = JSON.parse(message.toString());
var jsonv = new validator(JSONdata); //JSONdata will the object you get from the API
if(jsonv.checkValidclientdata())
{
//if the object is correct and validated, do something
}
If you need any help, contact me at jelle.debuyzere@student.vives.be https://www.npmjs.com/package/bug-jsonv