valix

1.0.5 • Public • Published

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 = 'nitschedev@gmail.com';

if (valix.isEmail(email)) {
    console.log(`rasmusnitsche@gmail.com 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');
}

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i valix

      Weekly Downloads

      0

      Version

      1.0.5

      License

      ISC

      Unpacked Size

      2.88 kB

      Total Files

      3

      Last publish

      Collaborators

      • nitschedev