{"id":16847521,"url":"https://github.com/fabiosantoscode/valilang","last_synced_at":"2025-03-18T07:17:23.255Z","repository":{"id":5313361,"uuid":"6495455","full_name":"fabiosantoscode/valilang","owner":"fabiosantoscode","description":"JSON-based language for performing client and server web form validation with the least duplicate code possible.","archived":false,"fork":false,"pushed_at":"2012-11-05T22:35:08.000Z","size":140,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T22:46:15.432Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fabiosantoscode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-01T19:18:56.000Z","updated_at":"2013-10-27T02:05:05.000Z","dependencies_parsed_at":"2022-07-05T13:12:54.313Z","dependency_job_id":null,"html_url":"https://github.com/fabiosantoscode/valilang","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiosantoscode%2Fvalilang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiosantoscode%2Fvalilang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiosantoscode%2Fvalilang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabiosantoscode%2Fvalilang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabiosantoscode","download_url":"https://codeload.github.com/fabiosantoscode/valilang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244173553,"owners_count":20410300,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T13:08:15.331Z","updated_at":"2025-03-18T07:17:23.231Z","avatar_url":"https://github.com/fabiosantoscode.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Valilang\n========\nCreate validation rules in a single format, meant to be used in both client and server sides.\n\n\nThe problem\n-----------\nIn web applications and websites, form validation is boring since (if you want to have neat web forms) you have to do it twice: On the server side, and on the client side, in Javascript. To make matters worse, you often find yourself repeating code time and time again.\n\n\nThe solution\n------------\nValilang is based upon JSON (for portability), and using it you will be able to define a set of validation rules for each of your form fields.\n\n```html\n\u003cscript type=\"text/x-valilang\"\u003e\n    {\n        \"fields\": [\"name\",  \"email\", \"recipients\"],\n        \"fieldValidation\": {\n            \"name\": [\n                \"required\",\n                \"min-10\",\n                \"max-50\",\n                \"split\",\n                \"listmax-2\"\n            ],\n            \"email\": [\n                \"required\",\n                \"min-3\",\n                \"max-60\",\n                \"email\"\n            ],\n            \"recipients\": [\n                \"required\",\n                \"split-,; \",\n                \"listmin-1\",\n                \"email\"\n            ]\n        }\n    }\n\u003c/script\u003e\n\u003cscript type=\"text/javascript\" src=\"valilang.js\"\u003e\u003c/script\u003e\n```\n\nBy creating a validation rules file and then including it from your page using a script tag, along with valilang.js, you have the client side covered. By default, valilang binds event handlers to `keyup`, for better responsiveness, however you will be able to change this.\n\nDevelopers will be able to create new rules (and only create client and serverside code for those rules), but a lot of predefined rules will be set in place.\n\n\nCurrent state\n-------------\nValilang is still under development. The format is not well defined, and server side libraries for several languages are not in place yet. However, I could certainly use some help. If you are interested in helping, fork and pull request!\n\nIf you want to create a port of valilang to a certain framework or language, create a github repository, and open an issue in the [valilang tracker][issues_url].\n\n [issues_url]: https://github.com/fabiosantoscode/valilang/issues","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiosantoscode%2Fvalilang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabiosantoscode%2Fvalilang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabiosantoscode%2Fvalilang/lists"}