{"id":21252846,"url":"https://github.com/kevinhellos/jscow","last_synced_at":"2025-03-15T05:41:34.906Z","repository":{"id":243694375,"uuid":"813166638","full_name":"kevinhellos/jscow","owner":"kevinhellos","description":"Lightweight model based validation library for Javascript (available via NPM)","archived":false,"fork":false,"pushed_at":"2024-06-10T16:17:54.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-21T21:08:33.243Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://npmjs.com/package/@kevinhellos/jscow","language":"JavaScript","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/kevinhellos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2024-06-10T15:39:25.000Z","updated_at":"2024-06-10T16:17:58.000Z","dependencies_parsed_at":"2024-06-10T18:24:22.517Z","dependency_job_id":"1d7ca2af-5771-4a9c-8340-d5dd02d6a46e","html_url":"https://github.com/kevinhellos/jscow","commit_stats":null,"previous_names":["kevinhellos/jscow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2Fjscow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2Fjscow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2Fjscow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kevinhellos%2Fjscow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kevinhellos","download_url":"https://codeload.github.com/kevinhellos/jscow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243690128,"owners_count":20331727,"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-11-21T03:49:06.552Z","updated_at":"2025-03-15T05:41:34.885Z","avatar_url":"https://github.com/kevinhellos.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jscow\njscow is a lightweight model based validation library for Javascript\n\n## Installation via npm\n```sh\nnpm i @kevinhellos/jscow\n```\n\n## Usage\n```js\n// Sample usage\nconst validate = require(\"@kevinhellos/jscow\");\n\n// Create a target\nvar username = \"@bob1234\";\n\n// Define a validation model\nvar usernameModel = {\n    required: true,\n    minLength: 8,\n    maxLength: 16,\n    specialCharacters: false,\n}\n\n// Checks a target with the validation model\n// use the validate(itemToValidate).with(modelValidation)\nif (validate(username).with(usernameModel)) {\n    console.log(\"Username is valid\");\n}\nelse {\n    console.log(\"Username is invalid\");\n}\n```\n\n## API\nBelow are the available properties to pass into the model validation object\n| Properties        | Type    | Description                                        |\n|-------------------|---------|----------------------------------------------------|\n| required          | boolean | Defines if the current variable is required or not |\n| minLength         | number  | Define the minimum length for a string             |\n| maxLength         | number  | Define the maximum length for a string             |\n| minValue          | number  | Define the minimum value for a number              |\n| maxValue          | number  | Define the maximum value for a number              |\n| specialCharacters | boolean | Define if special characters are allowed           |\n| isEmail           | boolean | Define if it should follows an email regex format  |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhellos%2Fjscow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkevinhellos%2Fjscow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkevinhellos%2Fjscow/lists"}