Coder Social home page Coder Social logo

coder-layne / vest Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ealush/vest

1.0 1.0 0.0 12.82 MB

Vest ✅ Declarative validations framework

Home Page: https://vestjs.dev/

License: MIT License

JavaScript 13.39% Shell 0.20% TypeScript 85.10% CSS 1.31%

vest's Introduction

Vest - Declarative validations framework

Vest Documentation

Join Discord Github Stars Version Downloads bundlephobia Status

Vest

Vest is a form-validation framework inspired by unit testing libraries like Mocha or Jest; It is designed to be easy to use and easy to learn by introducing their declarative syntax.

The idea behind Vest is that your validations can be described as a suite - a contract that reflects your form or feature structure. Vest is framework agnostic, meaning it can be used with any UI framework, or without any framework at all.

Using Vest for form validation can reduce bloat, improve feature readability and maintainability.

test('username', 'Username is required', () => {
  enforce(data.username).isNotBlank();
});

test('username', 'Username must be at least 3 chars', () => {
  enforce(data.username).longerThanOrEquals(3);
});

Installation

npm i vest

Motivation

Writing forms is an integral part of building web apps, and even though it may seem trivial at first - as your feature grows over time, so does your validation logic grows in complexity.

Vest tries to remediate this by separating validation logic from feature logic, so it's easier to maintain over time and refactor when needed.

Why Vest?

💡 Vest is easy to Learn. Vest adopts the syntax and style of unit testing frameworks, so you can leverage the knowledge you already have to write your form validations.

🎨 Vest is framework agnostic. You can use Vest with any UI framework out there.

🧠 Vest takes care of all the annoying parts for you. It manages its validation state, handles async validations, and much more.

🧩 Vest is extendable. You can easily add new kinds of validations to Vest according to your needs.

♻️ Validation logic in Vest can be shared across multiple features in your app.

Getting Started

Vest Documentation

Here are some code sandboxes to get you started:

vest's People

Contributors

adife avatar codechips avatar dependabot-preview[bot] avatar dependabot[bot] avatar ealush avatar elliot-alexander avatar eyalcohen4 avatar galezra avatar galitpauz avatar ganeshpatil0101 avatar gaspoute avatar gaweki avatar havlasme avatar hpsharon avatar kapalex avatar lirantal avatar lpizzinidev avatar moses3301 avatar norbertluszkiewicz avatar omrilugasi avatar ronen-e avatar saard avatar syncush avatar vligas avatar vuchl avatar wafflepie avatar yakkomajuri avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.