smart-model-validator

    0.0.5 • Public • Published

    smart-model-validator

    Build Status GitHub issues GitHub license

    It validate model as object against specific rules. It's has following features

    -- Custom error message -- Accept custom validation

    Version

    0.0.5

    Installation

    Install package globally:

    $ npm install -g smart-model-validator

    Or inside project:

    $ npm install smart-model-validator --save

    Examples

    //require library
    var ModelValidator = require('smart-model-validator');
     
     
    var modelValidator = new ModelValidator();
    modelValidator.setRules({name:{require:true, type: 'string'}});
    console.log(modelValidator.isValid({name: 'Mr. Smith'}));   //true

    Supported Validation

    - String
    - Int
    - Base64
    - Boolean
    - Date
    - Float
    - IP
    - ISBN
    - SO8601
    - JSON
    - UUID
    

    Install

    npm i smart-model-validator

    DownloadsWeekly Downloads

    2

    Version

    0.0.5

    License

    MIT

    Last publish

    Collaborators

    • avatar