🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

auth-validify

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-validify

Your go-to JavaScript package for hassle-free form validation. Simplify error-checking, enhance user experience, and make your forms shine effortlessly.

1.0.5
latest
Source
npm
Version published
Weekly downloads
4
-55.56%
Maintainers
1
Weekly downloads
 
Created
Source

Auth Valdify: Powerful and Customizable Validation for Node.js

npm version

auth-validify simplifies and strengthens data validation in your Node.js applications. It provides a comprehensive set of validation functions for common data types, along with options for customization to meet your specific needs.

This library empowers you to:

  • Ensure the integrity and security of user-submitted data.
  • Prevent invalid inputs from reaching your backend logic.
  • Enhance user experience with clear and actionable error messages.

Installation

npm install auth-validify

Usage

Offer practical examples demonstrating how to use each validation function:

Usage

1. Basic Validation:

    const { validator } = require('auth-validify');

    const email = 'someone@email.com';
    const password = 'StrongPassword123!';

    if (validator.isEmail(email) && validator.isValidPassword(password)) {
        console.log('Valid email and password!');
    } else {
        // Provide helpful error messages
        if (!validator.isEmail(email)) {
            console.error('Invalid email format.');
        }
        if (!validator.isValidPassword(password)) {
            console.error('Password must be at least 8 characters long and contain a combination of letters, numbers, and special characters.');
        }
    }
    const { validator } = require('auth-validify');

    // Set custom password length (minimum 12 characters)
    const options = { minLength: 12 };

    if (validator.isValidPassword(password, options)) {
        console.log('Password meets custom criteria!');
    } else {
    // ... (error handling)
    }

Features and Benefits

  • Comprehensive Validation: Covers common data types like email, password, phone number, username, and URL.
  • Customizable Rules: Tailor validation criteria to your application's specific needs (e.g., minimum password length, allowed email domains).
  • Clear Error Handling: Throw informative exceptions or provide custom error messages for better debugging and user experience.
  • Asynchronous Support: Enables seamless integration with promises or async/await patterns.
  • Well-Documented: Provides detailed documentation with clear examples and API descriptions.

Contribution

We welcome contributions to improve auth-validify. Feel free to submit pull requests for bug fixes, new features, or improved documentation.

License

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

Author

Buy Me a Coffee

If you find this library helpful, consider buying me a coffee to support further development:

Buy me a coffee

Keywords

validation

FAQs

Package last updated on 22 Mar 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