nvoice-validations
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

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.

email

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

Readme

Keywords

none

Package Sidebar

Install

npm i nvoice-validations

Weekly Downloads

2

Version

0.1.4

License

MIT

Unpacked Size

225 kB

Total Files

24

Last publish

Collaborators

  • _silali