{"id":21916980,"url":"https://github.com/gaintime/br-validator","last_synced_at":"2025-04-19T05:36:54.956Z","repository":{"id":30690905,"uuid":"125627258","full_name":"GainTime/br-validator","owner":"GainTime","description":"Validação de cpf, cnpj, data e cep no padrão brasileiro","archived":false,"fork":false,"pushed_at":"2023-01-01T23:31:40.000Z","size":211,"stargazers_count":7,"open_issues_count":9,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-18T12:18:49.862Z","etag":null,"topics":["celular","cep","cnpj","cpf","hacktoberfest","javascript","phone","pure","pure-javascript","telefone","validacao-de-cep","validacao-de-cnpj","validacao-de-cpf","validator"],"latest_commit_sha":null,"homepage":"http://gaintime.github.io/br-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/GainTime.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-03-17T12:33:02.000Z","updated_at":"2021-10-18T21:40:07.000Z","dependencies_parsed_at":"2023-01-14T17:29:00.863Z","dependency_job_id":null,"html_url":"https://github.com/GainTime/br-validator","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GainTime%2Fbr-validator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GainTime%2Fbr-validator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GainTime%2Fbr-validator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GainTime%2Fbr-validator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GainTime","download_url":"https://codeload.github.com/GainTime/br-validator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249619928,"owners_count":21301146,"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":["celular","cep","cnpj","cpf","hacktoberfest","javascript","phone","pure","pure-javascript","telefone","validacao-de-cep","validacao-de-cnpj","validacao-de-cpf","validator"],"created_at":"2024-11-28T19:22:23.902Z","updated_at":"2025-04-19T05:36:54.939Z","avatar_url":"https://github.com/GainTime.png","language":"JavaScript","readme":"## Como começar\n\n### ESM\n\n```\nnpm install br-validator\n```\n\n```js\nimport Br from 'br-validator'\n\n// options é opcional, se vc não passar nada, será:\nconst options = {\n    css: true // Utilizar nosso stylesheet,\n    messages: true // Utilizar nossas mensagens de erro\n}\n\nconst br = new Br(options)\nconst BR = br.init()\n```\n\n### text/javascript\n\n```\nnpm install br-validator@4.1.0-script\n```\n\nSerá criada uma variável global chamada `br`\n\n```html\n\u003cscript type=\"text/javascript\" src=\"br-validator/build/index.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  br.init() // Configuração padrão\n\n  // ou\n  new br.Br(options).init() // Assim você pode personalizar\n\u003c/script\u003e\n```\n\n## Como utilizar\n\nAdicione o atributo data-validate aos inputs que deseja validar, tal que o valor do atributo pode ser cpf, cnpj, date, brPhone, cep, text ou num.\n\n```html\n\u003cinput type=\"text\" data-validate=\"cpf\" /\u003e\n```\n\nPara validar ceps, utilizamos um formato diferente:\n\n```html\n\u003cscript\u003e\n  const BR = br.init()\n\n  BR.fields.cep.forEach((e) =\u003e {\n    e.addEventListener('blur', function (f) {\n      console.log(f)\n      br.cep(f.target, (response) =\u003e {\n        console.log(response)\n      })\n    })\n  })\n\u003c/script\u003e\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaintime%2Fbr-validator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgaintime%2Fbr-validator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgaintime%2Fbr-validator/lists"}