New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

raysk-vali

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raysk-vali

# install

  • 2.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

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

Keywords

FAQs

Package last updated on 11 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc