{"id":13527310,"url":"https://github.com/CharlGottschalk/approvejs","last_synced_at":"2025-04-01T09:31:23.014Z","repository":{"id":57182950,"uuid":"63429596","full_name":"CharlGottschalk/approvejs","owner":"CharlGottschalk","description":"A simple JavaScript validation library that doesn't interfere","archived":false,"fork":false,"pushed_at":"2021-11-11T15:40:09.000Z","size":8322,"stargazers_count":336,"open_issues_count":2,"forks_count":20,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-02T02:03:56.622Z","etag":null,"topics":["approve","form","form-validation","javascript","javascript-library","validation","validations","validator"],"latest_commit_sha":null,"homepage":"https://charlgottschalk.github.io/approvejs/docs/","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/CharlGottschalk.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":"2016-07-15T14:51:32.000Z","updated_at":"2024-10-10T10:57:42.000Z","dependencies_parsed_at":"2022-09-12T23:50:26.648Z","dependency_job_id":null,"html_url":"https://github.com/CharlGottschalk/approvejs","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlGottschalk%2Fapprovejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlGottschalk%2Fapprovejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlGottschalk%2Fapprovejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CharlGottschalk%2Fapprovejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CharlGottschalk","download_url":"https://codeload.github.com/CharlGottschalk/approvejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246616080,"owners_count":20806050,"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":["approve","form","form-validation","javascript","javascript-library","validation","validations","validator"],"created_at":"2024-08-01T06:01:45.496Z","updated_at":"2025-04-01T09:31:22.640Z","avatar_url":"https://github.com/CharlGottschalk.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# ApproveJs\n#### A simple validation library that doesn't interfere\n![release](https://img.shields.io/github/release/charlgottschalk/approvejs.svg) ![npm](https://img.shields.io/npm/v/approvejs.svg) [![CDNJS](https://img.shields.io/cdnjs/v/approvejs.svg)](https://cdnjs.com/libraries/approvejs) [![Build Status](https://travis-ci.org/CharlGottschalk/approvejs.svg?branch=master)](https://travis-ci.org/CharlGottschalk/approvejs) ![downloads](https://img.shields.io/npm/dt/approvejs.svg)\n\n---\n\nApproveJs doesn't automatically attach itself to input change events or form submit events. It also doesn't manipulate the DOM for you by automatically displaying errors. This allows you to automate validation how you want.\n\nWith a single method (`approve.value()`), you can decide how to handle validation.\n\nIf you like to be in control or have a little OCD like me, ApproveJs is for you.\n\nApproveJs is also easily extended with [custom tests](https://charlgottschalk.github.io/approvejs/docs/custom-tests).\n\n---\n\n### Installation\n\n##### Standalone\n\n[Download Latest Release](https://github.com/CharlGottschalk/approvejs/archive/master.zip)\n\nUnzip `master.zip` into your desired folder and add a `script` tag to the library before the end of your closing `\u003cbody\u003e` tag\n\n```html\n\u003cscript src=\"path/to/approve.min.js\"\u003e\u003c/script\u003e\n```\n\n##### Bower\n\nIn your terminal run:\n\n```\n$ bower install approvejs\n```\n\nAdd a `script` tag to the library before the end of your closing `\u003cbody\u003e` tag\n\n```html\n\u003cscript src=\"path/to/bower_components/approvejs/dist/approve.min.js\"\u003e\u003c/script\u003e\n```\n\n##### cdnjs\n\nAdd a `script` tag to the library CDN url before the end of your closing `\u003cbody\u003e` tag\n\n```html\n\u003cscript src=\"https://cdnjs.cloudflare.com/ajax/libs/approvejs/[version]/approve.min.js\"\u003e\u003c/script\u003e\n```\n\nGet the cdn urls from [here](https://cdnjs.com/libraries/approvejs)\n\n*Many thanks to [cdnjs](https://cdnjs.com/) who kindly hosts ApproveJS through a reliable CDN*\n\n##### Node\n\nIn your terminal run:\n\n```\n$ npm install approvejs\n```\n\nor if you're using [Yarn](https://yarnpkg.com/)\n\n```\n$ yarn add approvejs\n```\n\nRequire `approvejs`.\n\n```javascript\nvar approve = require('approvejs');\n```\n\n---\n\n### Usage\n\nApproveJS exposes a single method `value` that takes two parameters.\n\nThe first parameter is the value to validate and the second is the set of rules to test against.\n\n```javascript\nvar rules = {\n    required: true,\n    email: true\n};\n\nvar result = approve.value('user@domain.com', rules);\n```\n\nThe returned `result` contains two properties:\n\n```javascript\n{\n    approved: boolean,\n    errors: []\n}\n```\n\n#### Accessing Errors\n\nYou can access errors returned by the result in one of two ways:\n\n##### Errors Property\n\n```javascript\nvar i = result.errors.length;\nwhile(i--) {\n    console.log(result.errors[i]);\n}\n```\n\n##### `.each` Method\n\nThe result object exposes an `each()` method for easily getting to errors.\n\n```javascript\nresult.each(function(error) {\n    console.log(error);\n});\n```\n\n---\n\nRead [documentation here](https://charlgottschalk.github.io/approvejs/docs/).\n\nIf you would like to contribute to the project, please read [contributing](https://charlgottschalk.github.io/approvejs/docs/contributing/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCharlGottschalk%2Fapprovejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCharlGottschalk%2Fapprovejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCharlGottschalk%2Fapprovejs/lists"}