{"id":23490256,"url":"https://github.com/stanleymasinde/mevn-validator","last_synced_at":"2025-04-15T04:56:39.333Z","repository":{"id":39726353,"uuid":"239875293","full_name":"StanleyMasinde/mevn-validator","owner":"StanleyMasinde","description":"simple validator for express js","archived":false,"fork":false,"pushed_at":"2023-01-06T20:05:52.000Z","size":258,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T04:56:16.041Z","etag":null,"topics":["express","express-middleware"],"latest_commit_sha":null,"homepage":"","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/StanleyMasinde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-11T22:11:57.000Z","updated_at":"2022-12-25T17:49:08.000Z","dependencies_parsed_at":"2023-02-06T08:31:37.102Z","dependency_job_id":null,"html_url":"https://github.com/StanleyMasinde/mevn-validator","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Fmevn-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Fmevn-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Fmevn-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StanleyMasinde%2Fmevn-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StanleyMasinde","download_url":"https://codeload.github.com/StanleyMasinde/mevn-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249010210,"owners_count":21197797,"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":["express","express-middleware"],"created_at":"2024-12-25T00:25:19.283Z","updated_at":"2025-04-15T04:56:39.309Z","avatar_url":"https://github.com/StanleyMasinde.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/mevn-validator.svg)](https://badge.fury.io/js/mevn-validator)\n## Validator For Express\n\n* Install the package `npm i mevn-validator`\n* The Validator must be instatiated with the `new KeyWord`\n```javascript\n   const Validator = require('mevn-validator')\n\n   // Create a validator instance\n   let validate = new Validator(fields: Object, rules: Object)\n   validate.validate()\n   .then(valid =\u003e {\n       // do something when the validation passes\n   })\n   .catch(messages =\u003e {\n       // You would probably need to send this to the user\n       // the messages contains the error messages\n   })\n\n   // OR like a cool kid 😎\n   new Validator(fields: Object, rules: Object).then(....).catch(...).finally(...)\n```\n* Rules are separted by **|** e.g `field: required|email`. The field under validation must be available and be a valid E-mail Address\n\n### Available rules\n1. #### Required\n  * Ensures that the field under validation is available `field: required`\n2. #### String\n  * The field under validation must be a valid String `field: string`\n3. #### Email\n  * The field under validation must be a valid String `field: email`\n4. #### Min:length\n  * The field under validation must be more than the given length `field: min:10`\n5. #### Max:length\n  * The field under validation must be less than the given length `field: max:20`\n\n  __More rules and Docs coming soon. Contributions are welcome__\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanleymasinde%2Fmevn-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstanleymasinde%2Fmevn-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstanleymasinde%2Fmevn-validator/lists"}