The
best
javascript schema validation library
const SchemaUser = new Schemy({
    email: String,
    password: String,
    confirm: Schemy.$ref('password')
});
SchemaUser.validate(input);
Read docs Find plugins