Skip to content
This repository was archived by the owner on Oct 17, 2023. It is now read-only.

comparaonline/validators

Repository files navigation

Validators

CircleCI

A collection of general purpose validations. Currently it only holds javascript validations supporting both CommonJS and the browser.

Getting Started

Node / NPM

Install

$ npm install comparaonline/validators

Use

var Validators = require('validators');
console.log(Validators.string.fullName('Foo Bar')); // will log true

You can use the ES2015 module sintax too:

import Validators from 'validators';
console.log(Validators.string.fullName('Foo Bar')); // will log true

Browser

  1. Download dist/validators.min.js

  2. Include it in your page:

    <script type="text/javascript" src="validators.js"></script>
  3. Use it under the global name Validators:

    alert(Validators.string.fullName('Foo Bar')); // will alert true

Validations

String

  • email
  • fullName
  • password

CL

  • nationalId
  • nationalIdLength
  • phone
  • plate

BR

  • cpf

CreditCard

  • creditCard
  • isAmericanExpress
  • isDinersClub
  • isMastercard
  • isVisa
  • isElo
  • isHipercard

Development

Run tests

$ npm test

Build dist browser-compatible js

$ npm run build

About

Collection of common validations

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 9

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy