formify-ishu
v1.0.2
Published
Lightweight form validation utilities for JS/React.
Maintainers
Readme
🧩 Formify Ishu
🚀 Simple, Powerful & Lightweight Form Validation for JavaScript & React
🧠 About
Formify Ishu ek lightweight, developer-friendly form validation library hai.
Ye JavaScript aur React dono me kaam karta hai, aur pre-built rules ke sath aata hai (email, phone, password, required).
📦 Installation
npm install formify-ishu
# or
yarn add formify-ishu
✨ Features:
⚡ Built-in validators (required, email, phoneIN, password)
⚛️ React Hook (useFormify)
🧩 TypeScript support
🪶 Lightweight (<3 KB gzipped)
🔥 Zero dependencies
🧠 Quick Start :
 JavaScript Example
import { validateForm } from "formify-ishu";
const formData = {
email: "ishu@gmail",
phone: "987654321",
password: "Hello12"
};
const rules = {
email: ["required", "email"],
phone: ["required", "phoneIN"],
password: ["required", "password"]
};
console.log(validateForm(formData, rules));
Output:
{
email: "Invalid email address",
phone: "Invalid phone number",
password: "Password must be 8+ chars with upper, lower, number & special char"
}
⚛️ React Hook Example:
import { useFormify } from "formify-ishu";
function LoginForm() {
const { values, errors, handleChange, handleSubmit } = useFormify(
{ email: "", password: "" },
{ email: ["required", "email"], password: ["required", "password"] }
);
return (
<form
onSubmit={(e) => {
e.preventDefault();
handleSubmit((data) => console.log("✅ Submitted:", data));
}}
style={{ display: "flex", flexDirection: "column", gap: "10px", width: "250px" }}
>
<input
placeholder="Email"
value={values.email}
onChange={(e) => handleChange("email", e.target.value)}
/>
{errors.email && <p style={{ color: "red" }}>{errors.email}</p>}
<input
type="password"
placeholder="Password"
value={values.password}
onChange={(e) => handleChange("password", e.target.value)}
/>
{errors.password && <p style={{ color: "red" }}>{errors.password}</p>}
<button>Login</button>
</form>
);
}
🧩 Validation Rules:
| Rule | Description |
| ---------- | -------------------------------------------------------------- |
| `required` | Field must not be empty |
| `email` | Valid email address |
| `phoneIN` | Indian phone number (starts with 6–9, 10 digits) |
| `password` | Must contain 8+ chars, 1 uppercase, 1 number, 1 special symbol |
🗺️ Roadmap :
Custom validation rules
Async API-based validators
Multi-language error messages
React Native support
🧰 Contributing :
1️⃣ Fork this repo
2️⃣ Run npm install
3️⃣ Make your changes
4️⃣ Run npm run build
5️⃣ Open a Pull Request 🚀
🧾 License :
MIT License © 2025 Ishu Kumar
👤 Author :
Ishu Kumar
📦 NPM
🐙 GitHub
✉️ [email protected]
<div align="center"> Made with ❤️ by <b>Ishu Kumar</b> </div> ```