Skip to content

FluntJS is a package to help you to validate your business rules

License

Notifications You must be signed in to change notification settings

luizhfraraujo/flunt-js

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flunt

Portuguese Version

Flunt for Java

You can find a port of this library to Java here: https://github.com/carlosbritojun/jflunt

Flunt for DotNet

You can find a port of this library to Dotnet here: https://github.com/andrebaltieri/flunt

FluntJS

FluntJS is a package to help you to validate your business rules

Instalation

This package is available through Node Package Manager (NPM) Packages: https://www.npmjs.com/package/flunt

NPM

npm install flunt

Yarn

yarn add flunt

Validations Available

Validation Description
isRequired Check if field has been send
hasMinLen Check if the field has the minimum length informed
hasMaxLen
isFixedLen
isEmail
isNullOrUndefined
isDate
dateIsGreaterThan
dateIsGreaterOrEqualsThan
dateIsLessThan
dateIsLessOrEqualsThan

Usage

const ValidationContract = require('flunt');

let contract = new ValidationContract();
contract.hasMinLen(req.body.name, 3, 'name', 'The name has been minimum 3 characters lenght');

// If data is invalid
if (!contract.isValid()) {
    return response.status(400).send(contract.errors());
}

About the Art

All logo, icons, colors and fonts were provided with love by Gregory Buso

About

FluntJS is a package to help you to validate your business rules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%