1.0.1 • Published 10 months ago

@namopanda/form-validation v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Form Validator

Form Validator is a lightweight npm package that provides various form validation functions to simplify form validation in JavaScript applications.

Installation

You can install the package via npm:

npm install @namopanda/form-validator

// Import the desired form validation functions from the package and use them in your JavaScript code.

const {
  validateEmail,
  validatePhoneNumber,
  validateAddress,
  validateName,
  validatePassword,
} = require('form-validator');

// Example usage
const email = 'test@example.com';
if (validateEmail(email)) {
  console.log('Email is valid.');
} else {
  console.log('Email is invalid.');
}

const phoneNumber = '1234567890';
if (validatePhoneNumber(phoneNumber)) {
  console.log('Phone number is valid.');
} else {
  console.log('Phone number is invalid.');
}

//Available Validation Functions
//The following form validation functions are available in this package:

validateEmail(email): Validates an email address.
validatePhoneNumber(phone): Validates a phone number.
validateAddress(address): Validates an address.
validateName(name): Validates a name.
validatePassword(password): Validates a password.
Please refer to the function descriptions in the source code for more details on their usage and return values.

License
This project is licensed under the MIT License. See the LICENSE file for details.