nvoice-validations
v0.1.4
Published
Nvoice Validations provides various rules for you to validate data. Inspired by Laravel validations.
Downloads
6
Readme
Introduction
Nvoice Validations provides various rules for you to validate data. Inspired by Laravel validations.
Validation Quickstart
install
npm i nvoice-validations
use
// index.js
import validator from '../src';
const { validate } = validator();
const data = {
name: '',
};
const rules = {
name: 'required',
};
const validator = await validate(data, rules);
Available Validation Rules
required
The field under validation must be present and not empty.
The field under validation must be a valid email address.
min:number
The field under validation must be a minimum of specified number
max:number
The field under validation must be a maximum of specified number