Speed up development with full-stack environments for every branch.

Learn More

Validating Models in Nodejs [indicative]

Forked from Hello World for Node.js.

89 Runs 184 Views 26 Copies

Validating models data in node js using https://www.npmjs.com/package/indicative

Saved

Saved

amanvirk 1

amanvirk
published 3 years ago

var validator = require('indicative');
validator.initialize();

var rules = {
    'name' : 'required|alpha'
};
var values = {
    'name': 'johny123'
};

validator.validate(rules,values).then(function(success){
    console.log(success);
}).catch(function(err){
    console.log(err);
}).done();
Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).