Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.09 KB

Readme.md

File metadata and controls

43 lines (33 loc) · 1.09 KB

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