Maanyakaran – Reusable framework for state based form validation( best for react and redux and vue.js)

Most of the modern UI frameworks rely on some form of data state. For example, A simple HTML form in react is actually stored either in redux or internal react state. Many times we have faced situations where we have re written the same validations rules across or within the projects.

Maanyakaran is a sanskrit word which means “validation” is a step towards creating a validation framework which offers

  1. Extensibility and reusability : Create your validation rules as simple JS functions with key as rule name and value as functions and Strategies.

  2. Clean and readable implementation : Configure Maanyakaran once in project and keep reusing it by simply creating a readable constraint map.

  3. Apply multiple rules on a single field and iterate over an array of objects : One of the features of maanyakarn enables you to apply multiple validation by just writing comma separated rules. Also it allows you to hint validation about an array of similar object hence validating all the elements of array by single set of constraints.

  4. Abstract all validation and distribute them as Strategies. : Group all the validation rules in simple strategies and use them across multiple codebases.

  5. Framework agnostic. : Written in vanilla JS and can be used on any framework or environment and supports all build tools.

  6. Open source forever. Will be open source forever : Invite collaborators to review and improve this work.

Links

NPM : https://www.npmjs.com/package/maanyakaran

Github : https://github.com/maanyakaran/core

Seasons Greetings and Best wishes

Author: Shantun Parmar

Leave a Reply

Your email address will not be published.