Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/katsew/minimal-validator

minimal validator for node.
https://github.com/katsew/minimal-validator

Last synced: 14 days ago
JSON representation

minimal validator for node.

Awesome Lists containing this project

README

        

[![Circle CI](https://circleci.com/gh/katsew/minimal-validator.svg?style=svg)](https://circleci.com/gh/katsew/minimal-validator)

# Minimal validator for Nodejs and Browser

This is a sample validator for sever/client JavaScript.
It includes html, password, mail validator.

# Usage

Please use with `require`, or `import` with Babel.

```

const validator = require('minimal-validator');
// If you do not give a RegExp argument, default RegExp applied.
const mailValidator = new validator.mail(/mail\@email\.com/);

mailValidator.validate("test") === false;
mailValidator.validate("[email protected]") === true;

```