inpudator
v0.0.0
Published
Input validation for vanila javascript
Downloads
1
Maintainers
Readme
Inpudator
Input validation for vanila javascript
Get Started
Install Inpudator
to your project.
pnpm install inpudator
Example
Simple login validation example.
import inpudator from "inpudator";
// define validation schema
const validations = {
name: inpudator("username", "example", {
min: 4,
small: true
}),
password: inpudator("password", "Example123@", {
min: 4,
small: true,
special: true
})
};
if (validations.name.valid && validations.password.valid) {
console.log("You are great!");
} else {
console.log(validations.name.first);
console.log(validations.password.first);
}