Skip to content

A small library that can validate Domain, Email, Text, PhoneNumber for now.

Notifications You must be signed in to change notification settings

k2glyph/Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Client-Side-Validator Build Status

A small library for validation stuff.

Feature:

  1. Domain Validation
  2. Email Validation
  3. Text Validation
  4. Phone Number Validation
  5. Number Validation

Installation

npm install client-side-validator or yarn add client-side-validator

Usage

ES5

var clientSideValidator = require("client-side-validator");

var FIELDS=clientSideValidator.FIELDS;
var validator=clientSideValidator.validator;
var fieldValues= [{ key: 'sender', type: FIELDS.PHONENUMBER, value:'98' },{ key: 'email', type: FIELDS.EMAIL, value:'[email protected]' }]
var response = validator(fieldValues);
console.log(response)

ES6

import { validator, FIELDS } from 'client-side-validator';

const fieldValues= [{ key: 'sender', type: FIELDS.PHONENUMBER, value:'98' },{ key: 'email', type: FIELDS.EMAIL, value:'[email protected]' }]
const response = validator(fieldValues);
console.log(response)

Tests

npm test

Contributing

About

A small library that can validate Domain, Email, Text, PhoneNumber for now.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •