0.1.11 • Published 8 years ago

darth-valider v0.1.11

Weekly downloads
6
License
ISC
Repository
github
Last release
8 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

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago