2.0.2 • Published 3 years ago

raysk-vali v2.0.2

Weekly downloads
13
License
ISC
Repository
github
Last release
3 years ago

Regex based validator for JavaScript.

install

npm i raysk-vali

or if you use yarn

yarn add raysk-vali

Usage

import Validate from 'raysk-vali'

OR

import { isEmail } from 'raysk-vali'

Example

isEmail("abc@example.com") // true
isEmail("abcexample.com") // false

isUrl("www.example.com")
isDate("12/12/2020")
isEmpty("  ")
isDigit(22)
password("password")
isAlphaChar("asd")
isMobileNumber("+919999999999")
isAlphaNumChar("asd12")
isPANNumber("ABCPK4956K")
isGSTNumber("27AAPFU0939F1Z0")
isVehicleNumber("UT 32 DR 6423") // for indian vehicle number format
isMongoObjectId("5e3a7141c65baa1c5d1dd92b")

isEven(20) // true
isOdd(20) // false

Custom Regex

you can pass custom regex for searching.

validate('YOUR VALUE', /^YOUR REGEX$/) : Boolean
import { validate } from 'raysk-vali'

const isValid = validate('this is awesome.', /^awesome$/)
console.log(isValid)

Used by

Frappe Cloud

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.19

5 years ago

1.1.0

5 years ago

1.0.20

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago