- Validator JS is a JavaScript library which helps check whether the data is correct or not, so this module is easy to use and validates data quickly and easily.
- We can install uid from terminal using the command
npm install validator
or, - We can install
validator
from npm
-
It is easy to get started and easy to use.
-
It is widely used and popular module for validation.
-
Simple functions for validation and return boolean.
-
equals(str, comparison) :- check if the string matches the comparison.
-
isAfter(str [, date]) :- check if the string is a date that's after the specified date (defaults to now).
-
isCreditCard(str):- check if the string is a credit card.
-
isCurrency(str [, options]) :- check if the string is a valid currency amount.
-
isDataURI(str):- check if the string is a data uri format.
-
isMobilePhone(str [, locale [, options]]):- check if the string is a mobile phone number,
-
isStrongPassword(str [, options]):- Check if a password is strong or not.