rvm-form-validator
v1.1.3
Published
A lib for simplifying form validations
Downloads
16
Maintainers
Readme
RVM Form Validator
A library to simplify the form Validation process. We have support for custom regex patterns which gives it the ability to make it super compatible with any application you are trying to build.
The library uses TS so the functions and its parameters are well defined making the easy to understand and use in the projects. Using all the experience gained by developing multiple applications using forms we have put together this library to ease the process of validating a form for anyone.
The library does not contain and vulnerabilities deeming it safe for any type of application.
Installation
Install "rvm-form-validator" with npm
npm install rvm-form-validator
Usage/Examples
import FormValidator from 'rvm-form-validator'
const validator = new FormValidator();
// To validate Text
const isTextValid = validator.validateString("test123",false,10,true);
console.log("Is text valid : ",isTextValid);
// To validate email
const isEmailValid = validator.validateEmail("[email protected]",true);
console.log("Is email valid : ",isEmailValid)
// output object for all validations
// {isValid : boolean, message : string}
// use isValid to check if the value is valid and if it is false then look at message for the reason
Supported Validation
- Text Validation
- Number Validation
- Phone Number Validation
- Email Validation
- Password Validation
- Start Date Validation
- End Date Validation
- Start DateTIme Validation
- End DateTime Validation
- Website URL Validation
- Drop Down Validation
- CheckBox Validation
- Radio Button Validation
- File Upload Validation