purevalid v1.2.5
Purevalid 🛡️
Purevalid
is a lightweight validation package designed for simple and efficient data validation in JavaScript projects. It is built with zero external dependencies, making it easy to integrate into various applications.
Installation
You can install the package using either NPM or Yarn. Run one of the following commands in your project directory:
NPM
npm install purevalid
Yarn
yarn add purevalid
Example Usage
To use the purevalid
package for data validation, follow the instructions below:
import { validate } from "purevalid";
const inValidInputs = validate([
{
name: "Name",
value: "ja",
validators: ["string", "null", "min|3", "max|10"], //min and max must be last
},
{
name: "Email",
value: "john@mail.com",
validators: ["email"],
},
{
name: "Age",
value: 36,
validators: ["number", "min|18", "max|35"],
},
]);
console.log(invalidInputs);
Standard validators
standardValidators = ['number', 'string','phone', 'email', 'password', 'date', 'null, 'min', 'max']
You can use various methods provided by purevalid
to validate different types of data such as strings, numbers, emails, and more.
Contribution 😊
Contributions to this package are welcome and greatly appreciated. You can contribute by fixing bugs, suggesting new features, improving documentation, or enhancing the existing functionalities. To contribute, follow these steps:
- Fork the repository on GitHub.
- Make the desired changes or improvements.
- Submit a pull request with a clear description of your changes and their benefits.
Your contributions will help make purevalid
more reliable and effective for the community.
Feel free to reach out to the package maintainer for any questions or support related to the package.
Please customize the documentation further to provide more information about specific use cases and functionalities of your purevalid
validation package.