0.1.11 • Published 10 years ago

darth-valider v0.1.11

Weekly downloads
6
License
ISC
Repository
github
Last release
10 years ago

darth-valider

A simple NodeJS validation module

How to install

npm install darth-valider

How to use

var dv = require('darth-valider');

// Basic Examples
dv("John Doe").equals("Jon Doe").errors;
// [ 'ValueMismatched' ]

dv("John Doe@example.com").isEmail().errors;
// [ 'InvalidEmail' ]

dv(5).isType("number").errors;
// [] As 5 is a number, the error array is empty

// Chained Examples

dv(5).equalsIgnoreCase("five").isType("string").errors;
// [ 'ValueMismatched', 'TypeMismatched' ]

Supported Validations

isEmpty()

equals(any)

equalsIgnoreCase(any)

isType(string)

isEmail()

minLength(number)

maxLength(number)

minValue(number)

maxValue(number)

isUpper()

isLower()

isAlpha()

isAlphanumeric()

0.1.11

10 years ago

0.1.10

10 years ago

0.1.9

10 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago