AI-Powered Dynamic Form Validator for Node.js
Form-Genius is an AI-powered, highly customizable, and dynamic form validation package for Node.js. It supports unlimited fields, real-time validation, AI-based auto-corrections, and customizable validation rules. Whether you're working on a simple contact form or a complex application requiring secure validation, Form-Genius is the perfect solution.
β
Unlimited Fields β Validate any number of fields dynamically.
β
AI-Powered Corrections β Suggests fixes for typos, formatting issues, and invalid inputs.
β
Auto Field-Type Detection β Automatically detects input type (email, phone, password, etc.).
β
Custom Rules Support β Define your own validation rules for full flexibility.
β
Real-Time Validation β Easily integrates with front-end frameworks like React, Vue, and Angular.
β
Multi-Language Support β Works with various languages and regional formats.
β
Security & Fraud Detection β AI-based algorithms prevent fake/spam submissions.
β
Lightweight & Fast β Designed for high-performance applications.
npm install form-genius
- Define your form fields.
- Set up validation rules for each field.
- Use
form-genius
to validate all inputs dynamically. - Get real-time feedback with errors and AI-generated suggestions.
const validateForm = require("form-genius");
const userData = {
email: "john.doe@gmal.com",
phone: "+123 456 7890",
password: "pass",
website: "htt://invalid-url.com",
age: "17",
username: "john_doe_123",
address: "1600 Amphitheatre Pkwy, California"
};
const validationRules = {
password: { minLength: 8 },
website: { type: "url" }, // User-defined type override
age: { type: "number", min: 18, max: 99 },
address: { type: "address" }, // AI-powered address validation
username: { type: "username", minLength: 3, maxLength: 15 }
};
console.log(validateForm(userData, validationRules));
{
"valid": false,
"errors": {
"password": "Password must be at least 8 characters",
"website": "Invalid URL format",
"age": "Must be at least 18"
},
"suggestions": {
"email": "john.doe@gmail.com",
"website": "http://invalid-url.com"
}
}
πΉ Basic Validations
- Required fields
- Min/max length
- Allowed characters
πΉ Data Type-Specific Validations
-
Email β Validate format, suggest correct domain (
gmal.com
βgmail.com
) - Phone Number β Auto-format numbers, detect invalid inputs
- Password β Strength validation (uppercase, numbers, special characters)
- Username β No spaces, supports underscores, min/max length
- URL β Ensures valid website addresses
-
Date β Ensures correct date formats (
MM-DD-YYYY
,YYYY-MM-DD
) -
Number β Range validation (
min
,max
) - Address β Uses Google Maps API for real-world validation
πΉ Advanced AI-Based Features
- Contextual Text Correction β AI fixes common typos
- Fraud Detection β Detects fake/spam submissions
- Real-Time Validation β Perfect for frontend form validation
Easily validate user input in your Express.js application.
const express = require("express");
const validateForm = require("form-genius");
const app = express();
app.use(express.json());
app.post("/register", (req, res) => {
const validationRules = {
email: { type: "email" },
password: { minLength: 8 },
username: { type: "username", minLength: 3, maxLength: 15 }
};
const result = validateForm(req.body, validationRules);
if (!result.valid) return res.status(400).json(result);
res.json({ success: true, message: "User registered successfully!" });
});
app.listen(3000, () => console.log("Server running on port 3000"));
β
E-commerce Websites β Validate shipping addresses, phone numbers, and payment details.
β
User Registration Forms β Secure authentication with strong passwords and valid emails.
β
Finance & Banking Apps β Validate account details securely.
β
Healthcare Applications β Ensure medical forms are properly filled.
β
Job Portals & Applications β Validate structured resume submissions.
Current Stable Version: 1.0.0
- π New Features: AI-powered validation, customizable rules, auto-detection
- π₯ Performance: Optimized for high-speed validation
We welcome contributions! Feel free to submit issues and pull requests.
- Fork the repository
- Create a new feature branch
- Make changes and commit
- Submit a pull request
If you love Form-Genius, consider buying me a coffee! β
This project is licensed under the MIT License. See the full LICENSE file for details.
π Form-Genius makes form validation smarter, faster, and more powerful. Install it today and take your form validation to the next level! π‘# form-genius