{"id":21707532,"url":"https://github.com/jenkinsdev/validatinator","last_synced_at":"2025-08-19T21:31:42.965Z","repository":{"id":12500998,"uuid":"15170595","full_name":"JenkinsDev/Validatinator","owner":"JenkinsDev","description":"Validatinator is a simple, yet effective, HTML form validation library built for JavaScript/Typescript. Validatinator was originally loosely based off of Laravel's validation system.","archived":false,"fork":false,"pushed_at":"2023-11-15T17:08:27.000Z","size":10732,"stargazers_count":108,"open_issues_count":0,"forks_count":10,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-12-09T19:38:23.813Z","etag":null,"topics":["form-validation","form-validator","javascript","library","typescript","validation","validator","vanilla","vanilla-js","vanilla-ts"],"latest_commit_sha":null,"homepage":"https://jenkinsdev.github.io/Validatinator/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JenkinsDev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-12-13T18:14:57.000Z","updated_at":"2024-10-15T23:34:33.000Z","dependencies_parsed_at":"2024-06-21T19:07:12.110Z","dependency_job_id":"ff77905f-ceba-4178-a9ca-dc34fa3dbcd0","html_url":"https://github.com/JenkinsDev/Validatinator","commit_stats":{"total_commits":154,"total_committers":6,"mean_commits":"25.666666666666668","dds":0.2142857142857143,"last_synced_commit":"449f6ab445021f491583d1d971183ad037a3dcaf"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JenkinsDev%2FValidatinator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JenkinsDev%2FValidatinator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JenkinsDev%2FValidatinator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JenkinsDev%2FValidatinator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JenkinsDev","download_url":"https://codeload.github.com/JenkinsDev/Validatinator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230367928,"owners_count":18215338,"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":["form-validation","form-validator","javascript","library","typescript","validation","validator","vanilla","vanilla-js","vanilla-ts"],"created_at":"2024-11-25T22:18:31.943Z","updated_at":"2024-12-19T03:09:53.763Z","avatar_url":"https://github.com/JenkinsDev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Validatinator (Reborn)\r\n\r\nCurrent Release: 2.0.8 [Reborn]\r\n\r\nValidatinator is a simple, yet effective, HTML form validation library built for JavaScript/TypeScript.\r\n\r\nThe project was originally loosely based off of Laravel's validation system, and has evolved since.\r\n\r\n### How to Use\r\n\r\n#### Installation\r\n\r\n```javascript\r\nnpm install validatinator\r\n```\r\n\r\n#### Example Usage\r\n\r\n```javascript\r\nimport { Validatinator } from \"validatinator\";\r\n\r\nconst validatinator = new Validatinator({\r\n  \".my-form-query-selector\": {\r\n    \".my-field-query-selector\": \"required|alpha\",\r\n    \".another-field\": \"min:3|max:10\",\r\n    \"input[type='checkbox']:last-of-type\": \"accepted\"\r\n  }\r\n});\r\n\r\n// async/await\r\nconst state = await validatinator.validate(\".my-form-query-selector\");\r\nconsole.log(state.valid); // or state.invalid\r\nconsole.log(state.getAllErrors()); // or state.getFieldErrors(\".another-field\")\r\n\r\n// or as a promise\r\nvalidatinator.validate(\".my-form-query-selector\").then((state) =\u003e {});\r\n```\r\n\r\n### Why does this exist?\r\n\r\nValidatinator originally existed through the want of giving to the development community. As of 2022, this project is \u003e6 years old, and has been stagnant for the majority of that time.\r\n\r\nWhile the library may have been stagnant, it has been poised to do well due to the fact that it \"just works\". Along with all of the technological advancements we've underwent in the past 6 years; now the core pillars of Validatinator's existence are locked to:\r\n\r\n* Zero dependencies\r\n* Ease of use\r\n* Framework \u0026 runtime agnostic (soon)\r\n* Configurable and override-able\r\n\r\nThe holy grail of ease-of-use JS/TS validation libraries.\r\n\r\n### Validation Methods\r\n\r\n* `\"accepted\"`\r\n* `\"alpha\"`\r\n* `\"alphaDash\"`\r\n* `\"alphaNum\"`\r\n* `\"alphaDashNum\"`\r\n* `\"between:2,10\"`\r\n* `\"betweenLength:2,10\"`\r\n* `\"contains:2,4,6,8,10,12\"`\r\n* `\"dateBefore:2022-02-04\"`\r\n* `\"dateAfter:2022-02-10\"`\r\n* `\"difference:.my-other-field-selector,false\"`\r\n* `\"digitsLength:3\"`\r\n* `\"digitsLengthBetween:3,10\"`\r\n* `\"email\"`\r\n* `\"ipvFour\"`\r\n* `\"max:500\"`\r\n* `\"maxLength:2\"`\r\n* `\"min:200\"`\r\n* `\"minLength:2\"`\r\n* `\"notIn:2,4,6,8,10,12\"`\r\n* `\"number\"`\r\n* `\"pattern:valid_regex_string\"`\r\n* `\"required\"`\r\n* `\"requiredIf:.another-field-selector,value-to-check\"`\r\n* `\"requiredIfNot:.another-field-selector,value-to-check\"`\r\n* `\"same:.another-field-selector,false\"`\r\n* `\"url\"`\r\n\r\n### Validation Method Notes\r\n\r\n* `difference` - The second argument is `strict` which when `false` performs case insensitive comparisons.\r\n* `same` - The second argument is `strict` which when `false` performs case insensitive comparisons.\r\n* `pattern` - The valid regex string will be compared against the field value and if any part of the value matches the string, it will be valid. To strictly match the field value one must include the \"starts with\" (`^`) and \"ends with\" (`$`) assertion characters. A backslash inside the regex string must be escaped to be processed as a literal backslash (ex: `\"pattern:\\\\d\"` to match any numeric digit).\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsdev%2Fvalidatinator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsdev%2Fvalidatinator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsdev%2Fvalidatinator/lists"}