{"id":26874192,"url":"https://github.com/uzrnem/smooth-validator","last_synced_at":"2026-04-28T08:33:27.600Z","repository":{"id":57364275,"uuid":"145242362","full_name":"uzrnem/smooth-validator","owner":"uzrnem","description":"Form validation for Javascript Frontend and Backend [Laravel Style]","archived":false,"fork":false,"pushed_at":"2022-05-19T05:13:39.000Z","size":114,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T14:11:33.275Z","etag":null,"topics":["es5","javascript","javascript-library","library","nodejs","nodejs-modules","validate","validation","validator"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/smooth-validator","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/uzrnem.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}},"created_at":"2018-08-18T18:10:37.000Z","updated_at":"2022-05-10T13:51:29.000Z","dependencies_parsed_at":"2022-09-13T21:00:50.431Z","dependency_job_id":null,"html_url":"https://github.com/uzrnem/smooth-validator","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzrnem%2Fsmooth-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzrnem%2Fsmooth-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzrnem%2Fsmooth-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uzrnem%2Fsmooth-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uzrnem","download_url":"https://codeload.github.com/uzrnem/smooth-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246447757,"owners_count":20779041,"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":["es5","javascript","javascript-library","library","nodejs","nodejs-modules","validate","validation","validator"],"created_at":"2025-03-31T09:34:11.131Z","updated_at":"2026-04-28T08:33:27.544Z","avatar_url":"https://github.com/uzrnem.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smooth-Validator for Javascript\n\n[![smooth-validator](https://img.shields.io/badge/validator-plain_javascript-green)](https://github.com/uzrnem/smooth-validator)\n[![npm version](https://img.shields.io/npm/v/smooth-validator.svg)](https://www.npmjs.com/package/smooth-validator)\n[![Bundle Zip Size](https://img.shields.io/bundlephobia/minzip/smooth-validator)](https://www.npmjs.com/package/smooth-validator)\n[![Bundle Size](https://img.shields.io/bundlephobia/min/smooth-validator)](https://www.npmjs.com/package/smooth-validator)\n\n\n## Getting Started\n\n### Installation\n\n```sh\nnpm install smooth-validator\n```\n\n### Usage\n[Smooth-Validator] provides you various types of validation for object.\n\n\n#### Code Example for Sign Up validation\n\nPass rules to be applied on data to the parser and parser will return validator which will validate data for you.\n\n```\nconst parser = require(\"smooth-validator\");\n\n//Sample signup validation\nvar rules = {\n  email : 'required|email|min:5|max:100',\n  password: 'required|min:6|max:30',\n  confirm_password: 'required|same:password'\n}\nvar validator = parser(rules) //parser returns validator, which can be used on data object\n\nvar data = {\n  email: 'gisueinc@gmail.com',\n  password: 'strong',\n  confirm_password: 'strong'\n}\nconsole.log(validator(data))\n//OUTPUT: { message: 'validation passed', errors: [] }\n```\n\n\n#### Code Example for Custom Message\n\n[Smooth-Validator] also supports custom message in error.\n\n```\nconst parser = require(\"smooth-validator\");\n\nrules = {\n  '*emailTo': [\"email\"],\n  created_at: 'after:tomorrow'\n}\n\nvar validate = parser(rules, {\n  message: {\n    'emailTo[].email': ':variable failed :type for :value at index :zero',\n    'created_at.after' : ':variable is not after :first_value'\n  }\n})\n\ndata = {\n  emailTo: [\"gmail.com\"],\n  created_at: new Date()\n}\nvar res = validate(data);\nconsole.log(res.message)\n/* Output: \n{\n  message: 'emailTo failed email for gmail.com at index 0',\n  errors: [\n    {\n      key: 'emailTo[]',\n      message: 'emailTo failed email for gmail.com at index 0'\n    },\n    { key: 'created_at', message: 'created_at is not after tomorrow' }\n  ]\n} */\n```\n\n## Documentation 📚\nPlease go through [documentation] from more details and examples\n\n## Contribution\nWe would love to get help from you on [Github].\n\n\nCore Team\n\n* [Bhagyesh Sunil Patel]\n\n[//]: # (These are reference links used in the body of this note)\n\n   [Bhagyesh Sunil Patel]: \u003chttps://www.linkedin.com/in/uzrnem\u003e\n   [Github]: \u003chttps://github.com/uzrnem/smooth-validator\u003e\n   [documentation]: \u003chttps://uzrnem.github.io/smooth-validator\u003e\n   [Smooth-Validator]: \u003chttps://www.npmjs.com/package/smooth-validator\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzrnem%2Fsmooth-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuzrnem%2Fsmooth-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuzrnem%2Fsmooth-validator/lists"}