1.1.1 • Published 5 years ago
nibzvln v1.1.1
Welcome to nibzvln 👋
JavaScript reusable chainable validation library
Install
yarn add nibzvlnor
npm install nibzvlnUsage
Chainable
nibzvln().numeric().minLength(3).validate("123"); // true
nibzvln().not().numeric().minLength(3).validate("hello"); // true
nibzvln().numeric().minLength(3).validate("hello"); // false
nibzvln().minLength(3).not().email().validate("hello"); // true
nibzvln().not().minLength(45).email().validate("example@example.com"); // trueExtendable
You can create your own custom validation rules
const customRules = {
foo: () => (text) => text === "bar";
}
nibzvln.defineCustomRules(customRules);And you can use them like built-in ones
nibzvln().minLength(3).foo().validate("bar"); // trueYou can also remove custom validation rules that are created
nibzvln.clearCustomRules();🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check issues page.