valix
v1.0.5
Published
Simple and fast package to validate form data.
Downloads
2
Maintainers
Readme
Valix Form Validator
Built for your efficiency...
With Valix Validator you can easy validate form data. For an example you can check if an email is an valid email or not
Current Features
- Check if an email is valid or not
- Check if a string is longer than 6 characters long. (Common for passwords)
- Check if two string have same value. For example password and confirm password
- Check if an string is empty
Installation
Valix requires Node.js v12.0.0+ to run.
$ npm i valix
Documentation
const valix = require('valix');
const email = '[email protected]';
if (valix.isEmail(email)) {
console.log(`[email protected] is an valid email`);
} else {
console.log('Email is not valid');
}
----------------------------------------------------------------
const valix = require('valix');
const username = 'NitscheDev';
if (valix.isEmptyl(username)) {
console.log('Username is required');
} else {
console.log('Username was given');
}
----------------------------------------------------------------
const valix = require('valix');
const password1 = 'test123';
const password2 = 'test1234';
if (valix.isEquall(password1, password2)) {
console.log('Passwords matches');
} else {
console.log('Passwords do not matches');
}
----------------------------------------------------------------
const valix = require('valix');
const password1 = 'test';
if (valix.isLength(password1)) {
console.log('Passwords is longer than 6');
} else {
console.log('Passwords is shorter than 6');
}