{"id":32621911,"url":"https://github.com/matthewnitschke/kavie","last_synced_at":"2025-10-30T19:03:04.503Z","repository":{"id":3303334,"uuid":"49015606","full_name":"matthewnitschke/Kavie","owner":"matthewnitschke","description":"Insanely Basic Knockout validation","archived":false,"fork":false,"pushed_at":"2023-09-27T20:42:18.000Z","size":6567,"stargazers_count":8,"open_issues_count":5,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-07-08T15:04:35.927Z","etag":null,"topics":["javascript","knockoutjs","plugin","validation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthewnitschke.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-01-04T18:37:46.000Z","updated_at":"2021-12-01T04:08:54.000Z","dependencies_parsed_at":"2024-10-22T09:26:45.836Z","dependency_job_id":null,"html_url":"https://github.com/matthewnitschke/Kavie","commit_stats":{"total_commits":213,"total_committers":6,"mean_commits":35.5,"dds":0.403755868544601,"last_synced_commit":"00f3becd2268170d9701eb9816ec49484a3b4941"},"previous_names":["mattnit/kavie"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/matthewnitschke/Kavie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewnitschke%2FKavie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewnitschke%2FKavie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewnitschke%2FKavie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewnitschke%2FKavie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewnitschke","download_url":"https://codeload.github.com/matthewnitschke/Kavie/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewnitschke%2FKavie/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281862824,"owners_count":26574710,"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","status":"online","status_checked_at":"2025-10-30T02:00:06.501Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["javascript","knockoutjs","plugin","validation"],"created_at":"2025-10-30T19:01:35.587Z","updated_at":"2025-10-30T19:03:04.490Z","avatar_url":"https://github.com/matthewnitschke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"![capture](https://cloud.githubusercontent.com/assets/6363089/22178397/32213fe4-dff2-11e6-86e5-f60431852bd7.PNG)\n\n[![Build Status](https://travis-ci.org/Knockout-Contrib/Knockout-Validation.svg)](https://travis-ci.org/matthewnitschke/Kavie)\n[![npm version](https://badge.fury.io/js/kavie.svg)](https://badge.fury.io/js/kavie)\n# Kavie\nKavie is a small and easy to use knockout js validation library.\n\n## Installation\nYou can download kavie from npm\n```\nnpm install kavie\n```\n\nThen include it in your project after knockout js\n```html\n\u003cscript src=\"/path/to/knockout.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"/node_modules/kavie/dist/kavie.js\"\u003e\u003c/script\u003e\n\n\u003c!-- Promise Polyfill for IE11 and Android support (only used with async validation) --\u003e\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/core-js/2.4.1/core.js\"\u003e\u003c/script\u003e\n```\nit can also be included via node modules\n```js\nvar ko = require('ko');\nvar Kavie = require('kavie');\n```\n\n# Usage\n\n```javascript\nfunction ViewModel(){\n  var self = this;\n  \n  self.value = ko.observable().extend({\n    kavie: {\n      required: true\n    }\n  });\n  \n  self.submit = function(){\n    if (Kavie.isValid(self)){\n      console.log(\"All Good!\");\n    }\n  }\n}\n```\n## Html Side\nKavie works by adding a hasError variable to the observable. This gives the flexibility to add color changing to any element you want\n\n```html\n\u003cinput type=\"text\" data-bind=\"textInput: value, css:{'error': value.hasError}\"/\u003e\n\u003cspan data-bind=\"visible: value.hasError\"\u003eUh Oh! There was an error!\u003c/span\u003e\n```\n\n# Validation Messages\nYou can use a validation message to display to the user if the validation failed\n\n```html\n\u003cinput data-bind=\"textInput: value\"\u003e\n\u003cdiv data-bind=\"text: value.errorMessage\"\u003e\u003c/div\u003e\n```\nThese validation messages are stored on the validators see [custom rules](https://github.com/matthewnitschke/Kavie/wiki/Custom-Rules) for more information\n\n# Validation rules\nThere are a few validation rules build in\n\n```javascript\nself.value = ko.observable().extend({\n    kavie: {\n      required: true, // [boolean] this one is obvious\n      maxLength: 3, // [int] max amount of characters: 3\n      minLength: 2, // [int] min amount of characters: 2\n      date: true, // [boolean] validates dates based on js dates\n      birthdate: true, // [boolean] uses date, and must be in past with persons age less than 120\n      phone: true, // [boolean] uses regex to validate a valid 10 digit phone number\n      email: true, // [boolean] uses regex to validate a valid email\n      numeric: true, // [boolean] must be an integer\n      regexPattern: /([A-Z])\\w+/ // [regex] matches a pattern\n    }\n});\n```\nIt is important to note that on the date, birthdate, phone, email, and numeric validators, if the users input is null, undefined, or empty they will return true. This is so you can still have optional values and use these validators. If you want them required, add the required validator.\n\n# More Features\nThere is much more to kavie, but in order to keep the readme simple the advanced features have been moved to the [wiki](https://github.com/matthewnitschke/Kavie/wiki)\n\n## Problems?\nThanks of taking a look at kavie. If you have any problems let me know and I would love to help you out\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewnitschke%2Fkavie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewnitschke%2Fkavie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewnitschke%2Fkavie/lists"}