@namopanda/form-validation

1.0.1 • Public • Published

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.

Package Sidebar

Install

npm i @namopanda/form-validation

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

3.3 kB

Total Files

3

Last publish

Collaborators

  • namopanda