nibzvln

1.1.1 • Public • Published

Welcome to nibzvln 👋

Version License: MIT

JavaScript reusable chainable validation library

Install

yarn add nibzvln

or

npm install nibzvln

Usage

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"); // true

Extendable

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"); // true

You 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.

/nibzvln/

    Package Sidebar

    Install

    npm i nibzvln

    Weekly Downloads

    0

    Version

    1.1.1

    License

    MIT

    Unpacked Size

    13 kB

    Total Files

    10

    Last publish

    Collaborators

    • zblash