{"id":16986926,"url":"https://github.com/amrdeveloper/validera","last_synced_at":"2025-03-22T02:11:31.658Z","repository":{"id":57390417,"uuid":"232375356","full_name":"AmrDeveloper/Validera","owner":"AmrDeveloper","description":"NodeJS object validation to check type and value with multi conditions","archived":false,"fork":false,"pushed_at":"2021-01-06T12:39:33.000Z","size":11,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T12:17:56.677Z","etag":null,"topics":["js","nodejs","nodejs-library","validation","validera"],"latest_commit_sha":null,"homepage":"","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/AmrDeveloper.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}},"created_at":"2020-01-07T17:11:32.000Z","updated_at":"2024-01-10T14:52:42.000Z","dependencies_parsed_at":"2022-09-15T21:23:45.741Z","dependency_job_id":null,"html_url":"https://github.com/AmrDeveloper/Validera","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/AmrDeveloper%2FValidera","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrDeveloper%2FValidera/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrDeveloper%2FValidera/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AmrDeveloper%2FValidera/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AmrDeveloper","download_url":"https://codeload.github.com/AmrDeveloper/Validera/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244894327,"owners_count":20527677,"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":["js","nodejs","nodejs-library","validation","validera"],"created_at":"2024-10-14T02:47:23.147Z","updated_at":"2025-03-22T02:11:31.641Z","avatar_url":"https://github.com/AmrDeveloper.png","language":"JavaScript","readme":"# Validera\r\n\r\nNodeJS object validation to check type and value with multi conditions\r\n\r\n![Version](https://img.shields.io/npm/v/validera.svg)\r\n![Downloads](https://img.shields.io/npm/dm/validera.svg)\r\n\r\n## Install\r\n\r\n```npm\r\nnpm install validera\r\n```\r\n\r\n## Usage\r\n\r\n```javascript\r\nconst validera = require('validera')\r\n```\r\n\r\n```javascript\r\nconst value = new validera(\"validera\")\r\n        .type(\"string\")\r\n        .nullOrEmpty()\r\n        .valueOrThrow()\r\n```\r\n\r\n```javascript\r\nconst value = new validera(\"validera\")\r\n        .type(\"string\")\r\n        .valueOrThrowMessage(\"It's not string\")\r\n```\r\n\r\n```javascript                    \r\nconst isValid = new validera(50)\r\n        .type(\"number\")\r\n        .positive()\r\n        .biggerThan(0)\r\n        .smallerThan(100)\r\n        .check()   \r\n```            \r\n\r\n```javascript\r\nvalidera.isTypeEqual(\"validera\", \"string\") //true\r\n\r\nvalidera.isEqualAny(1, [2,3,4])                 //false\r\nvalidera.isNotEqualOneof(1, [2,3,4])            //true\r\nvalidera.isNotEqualOneof(1, [2,3,4], 5)         //true\r\nvalidera.isNotNull(null)                        //false\r\n\r\nvalidera.isPositive(1)                          //true\r\nvalidera.isNegative(-1)                         //true\r\n\r\nvalidera.isBiggerThanOneof(9, 1, 11, [5,6])     //true\r\nvalidera.isBiggerThanAllof(9, 1, 2, [5,6])      //true\r\nvalidera.isBiggerOrEqualOneof(9, [11, 12, 9])   //true\r\n\r\nvalidera.isSmallerThanOneof(9, [10, 0])         //true\r\nvalidera.isSmallerThanAllof(9, [10, 11 ,12])    //true\r\nvalidera.isSmallerOrEqualOneof(9, [1, 2, 9])    //true\r\n\r\nvalidera.isNullorEmpty(\"\")                      //true\r\nvalidera.isNullOrZero(null)                     //true \r\nvalidera.isZeroOrDefault(0, 10)                 //10\r\nvalidera.isNullOrDefault(null, 0)               //0\r\n```\r\n\r\nIf you have an idea or new check to improve Validera you can submit issue or Pull Request.\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrdeveloper%2Fvalidera","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famrdeveloper%2Fvalidera","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrdeveloper%2Fvalidera/lists"}