npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

validation-master

v1.0.34

Published

Collection of various validation function

Downloads

68

Readme

validation-master-logo

validation-master is a tiny module which provides lots of validation methods.Currently, It has 17 methods which are mentioned below.

|Method|Description| |----|-----| |pincodeValidator|Validates pincode number and returns a boolean value.| |birthYearValidator|Validates birth year and returns a boolean value.| |phoneNumberValidator|Validates phone number and returns a boolean value.| |panCardValidator|Validates pancard number and returns a boolean value.| |drivingLicenseValidator|Validates driving license number and returns a boolean value.| |aadharCardValidator|Validates aadhaar card number and returns a boolean value.| |emailValidator|Validates email address and returns a boolean value.| |isAlphabetic|Checks if string is alphabetic and returns a boolean value.| |isNumeric|Checks if string is numeric and returns a boolean value.| |isAlphaNumeric|Checks if string is alphanumeric and returns a boolean value.| |isValidDate|Checks if date is in valid format and returns an array containing boolean value and date.If you pass true in third parameter isBoolean then it will return an array containing boolean value and a date with ISO format| |isFutureDate|Checks if date is future date and returns boolean value.| |isPastDate|Checks if date is past date and returns boolean value.| |isCurrentDate|Checks if date is current date and returns boolean value.| |isEighteenPlus|Checks if age is eighteen plus and returns an array containing boolean value and age.| |isEmpty|Checks if string is empty string and returns boolean value.| |isURL|Checks if string is url and returns boolean value.|

pincodeValidator

Validates pincode number and returns a boolean value.

Example

const pincode = "Your_Area_Pincode"
console.log(pincodeValidator(pincode))

birthYearValidator

Validates birth year and returns a boolean value.

Example

const birthYear = "Your_Birth_Year"
console.log(birthYearValidator(birthYear))

phoneNumberValidator

Validates phone number and returns a boolean value.

Example

const phoneNumber = "Your_Phone_Number"
console.log(phoneNumberValidator(phoneNumber))

panCardValidator

Validates pancard number and returns a boolean value.

Example

const pancardNumber = "Your_Pancard_Number"
console.log(panCardValidator(pancardNumber))

drivingLicenseValidator

Validates driving license number and returns a boolean value.

Example

const drivingLicenseNumber = "Your_Driving_License_Number"
console.log(drivingLicenseValidator(drivingLicenseNumber))

aadharCardValidator

Validates aadhaar card number and returns a boolean value.

Example

const aadhaarCardNumber = "Your_Aadhaar_Card_Number"
console.log(aadharCardValidator(aadhaarCardNumber))

emailValidator

Validates email address and returns a boolean value.

Example

const emailAddress = "Your_Email_Address"
console.log(emailValidator(emailAddress))

isAlphabetic

Checks if string is alphabetic and returns a boolean value.

Example

const customString = "xyz"
console.log(isAlphabetic(customString))

isNumeric

Checks if string is numeric and returns a boolean value.

Example

const customString = "123"
console.log(isNumeric(customString))

isAlphaNumeric

Checks if string is alphanumeric and returns a boolean value.

Example

const customString = "xyz123"
console.log(isAlphaNumeric(customString))

isValidDate

Checks if date is in valid format and returns an array containing boolean value and date. It also corrects date and month if it is entered in single digit. Supported Date Formats -> DD-MM-YYYY, DD/MM/YYYY, DD.MM.YYYY If you pass true in third parameter isBoolean then it will return an array containing boolean value and a date with ISO format (YYYY-MM-DD).

Example

const date = "01-07-2021"
console.log(isValidDate(date, "-", false))

isFutureDate

Checks if date is future date and returns boolean value.

Example

const date = "02-07-2021"
console.log(isFutureDate(date))

isPastDate

Checks if date is past date and returns boolean value.

Example

const date = "30-06-2021"
console.log(isPastDate(date))

isCurrentDate

Checks if date is current date and returns boolean value.

Example

const date = "30-06-2021"
console.log(isCurrentDate(date))

isEighteenPlus

Checks if age is eighteen plus and returns an array containing boolean value and age.

Example

const date = "01-01-2003"
console.log(isEighteenPlus(date, "-"))

isEmpty

Checks if string is empty string and returns boolean value.

Example

const string = ""
console.log(isEmpty(string))

isURL

Checks if string is url and returns boolean value.

Example

const url = "https://www.google.com"
console.log(isURL(url))