@suryarajendran/input-validator
v1.0.0
Published
A library for validating various types of inputs
Downloads
6
Maintainers
Readme
Input Validator
A library for validating various types of inputs such as emails, URLs, phone numbers, and credit card numbers.
Installation
npm install input-validator
# here is sample usage
const validator = require('input-validator');
const email = '[email protected]';
const url = 'https://www.example.com';
const phone = '+1234567890';
const cardNumber = '4111111111111111';
console.log(validator.isValidEmail(email)); // true
console.log(validator.isValidURL(url)); // true
console.log(validator.isValidPhoneNumber(phone)); // true
console.log(validator.isValidCreditCard(cardNumber)); // true