/nvalid

Nvalid is a minimalist JavaScript library for validations

Primary LanguageTypeScriptMIT LicenseMIT

Caricati.io - Design System

npm tests and build MIT


nvalid

A lightweight validation library written in JavaScript.

Install

Install nvalid dependency using node package manager:

npm i @caricati/nvalid

Using

Use only a fragment from the library:

import { isEmail } from '@caricati/nvalid'

isEmail('invalid email@here') // false
isEmail('name@email.com') // true

Use a collection of validations:

import validate from '@caricati/nvalid'

validate('user@email.com').email().required() // passed
validate('Mr. Caricati').string().required() // passed

validate('my ip').ip() // handle exception
validate('').required() // handle exception