FORML (Form Lazy)
Simple form data validation
Introduction
Installation
# NPM $ npm install forml --save # Yarn $ yarn add forml
Basic Usage
const input = firstname: 'John' lastname: 'Doe' email: 'johnDoe@domain.com' const rules firstname: required: true length: 5 custom: input error => if input === 'John' errormessage = 'John is banned from this system' return error; } lastname: required: true legnth: 3 email: email: true } const hasErrors = Forml; if hasErrorslength console; // Everything is fine ...