Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

multiform-validator

Package Overview
Dependencies
Maintainers
0
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiform-validator

Javascript library made to validate, several form fields, such as: email, images, phone, password, cpf etc.

  • 2.4.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
406
increased by244.07%
Maintainers
0
Weekly downloads
 
Created
Source

[!NOTE] I accept help to make the version of the other programming languages.

Multiform-validator

npm version License: MIT npm downloads

This npm package provides JavaScript functions to validate various forms fields.

Documentation: https://multiformvalidator.netlify.app

Feel free to find bugs and report them to me. Your feedback is highly appreciated. Hugs from Gabriel Logan!

CDNs

ESM:

jsDelivr:

https://cdn.jsdelivr.net/npm/multiform-validator@2.4.0/+esm
<script type="module">
	import multiform-validator from "https://cdn.jsdelivr.net/npm/multiform-validator@2.4.0/+esm"
</script>

CJS:

unpkg:

https://unpkg.com/multiform-validator@2.4.0/dist/cjs/index.cjs
<script src="https://unpkg.com/multiform-validator@2.4.0/dist/cjs/index.cjs"></script>

Example of use with CDN

using cjs:

<script src="https://unpkg.com/multiform-validator@2.4.0/dist/cjs/index.cjs"></script>
<script>
	const emailResult = isEmail("123456");
	const cpfResult = cpfIsValid("123456");

	console.log(emailResult); // returns false
	console.log(cpfResult.isValid); // returns false
</script>

or

using esm:

<script type="module">
	import multiformValidator from "https://cdn.jsdelivr.net/npm/multiform-validator@2.4.0/+esm";
	const emailResult = multiformValidator.isEmail("123456");
	const cpfResult = multiformValidator.cpfIsValid("123456");

	console.log(emailResult); // returns false
	console.log(cpfResult.isValid); // returns false
</script>

Installation

npm install multiform-validator

or

yarn add multiform-validator

or

pnpm add multiform-validator

Data Validator

This package contains various modules for validating different types of data. Below are the available validation modules:

Available Validation Modules

  • cnpjValidator: CNPJ validation.
  • cpfValidator: CPF validation.
  • getOnlyEmail: Extracts only the email or emails address from a string.
  • identifyFlagCard: Identifies the flag of a credit card.
  • isAscii: Checks if the string contains only ASCII characters.
  • isBase64: Checks if the string is a valid Base64 encoding.
  • isCEP: CEP validation (Brazilian postal code).
  • isCreditCardValid: Credit card validation.
  • isDate: Date format validation.
  • isDecimal: Checks if the number is a decimal.
  • isEmail: Email address validation format.
  • isEmpty: Checks if the string is empty.
  • isMACAddress: MAC address validation.
  • isMD5: Checks if the string is a valid MD5 hash.
  • isNumber: Checks if the value is a number.
  • isPort: Port number validation.
  • isPostalCode: Postal code validation.
  • isTime: Time format validation.
  • isValidAudio: Audio file validation.
  • isValidImage: Image file validation.
  • isValidPdf: Pdf file validation.
  • isValidTxt: Txt file validation.
  • isValidVideo: Video file validation.
  • passwordStrengthTester: Password strength test.
  • validateBRPhoneNumber: Brazilian phone number validation.
  • validateEmail: Email address full validation.
  • validateName: Name validation.
  • validatePassword: Password validation.
  • validatePassportNumber: Passport number validation.
  • validatePhoneNumber: Phone number validation.
  • validateSurname: Surname validation.
  • validateTextarea: Textarea validation.
  • validateUsername: Username validation.
  • validateUSPhoneNumber: US phone number validation.

You can use it in React Native, Angular, any javascript framework or any javascript or typescript code.

Example using Reactjs:

Example using Reactjs Showing error options Showing error in browser

For better information, read the documentation

const validator = require("multiform-validator");
// or
import validator from "multiform-validator";

or;

// Attention, FUNCTION_NAME is not a valid function name! It is just an example of how to import the functions.

const { FUNCTION_NAME } = require("multiform-validator");
// or
import { FUNCTION_NAME } from "multiform-validator";

Documentation

https://multiformvalidator.netlify.app

Feel free to explore the various functions and experiment with different inputs to understand their behavior. If you encounter any issues or have suggestions, don't hesitate to reach out to me. Your feedback is valuable and helps improve the package. Happy coding!

If you want to help me, you can buy me a coffee (:

Buy Me A Coffee

By - Gabriel Logan

Keywords

FAQs

Package last updated on 13 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc