{"id":21445381,"url":"https://github.com/peralva/validate-cpf-cnpj","last_synced_at":"2026-01-28T21:30:59.773Z","repository":{"id":259705860,"uuid":"879261025","full_name":"peralva/validate-cpf-cnpj","owner":"peralva","description":"Validate CPF and CNPJ","archived":false,"fork":false,"pushed_at":"2024-11-30T17:31:20.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-27T10:56:51.708Z","etag":null,"topics":["cnpj","cpf","validate"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@peralva/validate-cpf-cnpj","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/peralva.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-10-27T12:51:26.000Z","updated_at":"2024-11-30T17:30:27.000Z","dependencies_parsed_at":"2024-10-27T13:40:58.418Z","dependency_job_id":"68970704-80ce-489c-ac84-452feee11165","html_url":"https://github.com/peralva/validate-cpf-cnpj","commit_stats":null,"previous_names":["peralva/validate-cpf-cnpj"],"tags_count":5,"template":false,"template_full_name":"peralva/npm-template","purl":"pkg:github/peralva/validate-cpf-cnpj","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peralva%2Fvalidate-cpf-cnpj","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peralva%2Fvalidate-cpf-cnpj/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peralva%2Fvalidate-cpf-cnpj/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peralva%2Fvalidate-cpf-cnpj/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peralva","download_url":"https://codeload.github.com/peralva/validate-cpf-cnpj/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peralva%2Fvalidate-cpf-cnpj/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28852727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cnpj","cpf","validate"],"created_at":"2024-11-23T02:26:42.082Z","updated_at":"2026-01-28T21:30:59.754Z","avatar_url":"https://github.com/peralva.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @peralva/validate-cpf-cnpj\n\nValidate CPF and CNPJ\n\n[![NPM Version](https://img.shields.io/npm/v/%40peralva%2Fvalidate-cpf-cnpj)](https://www.npmjs.com/package/@peralva/validate-cpf-cnpj?activeTab=versions)\n[![GitHub Release Date](https://img.shields.io/github/release-date/peralva/validate-cpf-cnpj)](https://github.com/peralva/validate-cpf-cnpj/releases)\n[![GitHub License](https://img.shields.io/github/license/peralva/validate-cpf-cnpj)](https://github.com/peralva/validate-cpf-cnpj?tab=MIT-1-ov-file#readme)\n[![NPM Downloads](https://img.shields.io/npm/dm/%40peralva%2Fvalidate-cpf-cnpj)](https://www.npmjs.com/package/@peralva/validate-cpf-cnpj)\n[![NPM Publish](https://github.com/peralva/validate-cpf-cnpj/actions/workflows/npm-publish.yml/badge.svg)](https://github.com/peralva/validate-cpf-cnpj/actions/workflows/npm-publish.yml)\n\n## Installation\n\n```bash\nnpm install --save @peralva/validate-cpf-cnpj\n```\n\n## Usage\n\n```ts\nimport { CpfCnpjError, validateCpfCnpj } from '@peralva/validate-cpf-cnpj';\n\nconst cpfCnpj = validateCpfCnpj('123 456 789 09', { clearData: true });\n\nconsole.log(cpfCnpj.parsed, cpfCnpj.masked);\n\ntry {\n\tvalidateCpfCnpj('12 345 678 9012 34', {\n\t\terrorMap(issue) {\n\t\t\tif (issue.type === 'digits') {\n\t\t\t\treturn `Issue Type: ${issue.type}\\nIssue Expected: ${issue.expected}\\nIssue Received: ${issue.received}\\nData Parsed: ${issue.data.parsed}\\nData Received: ${issue.data.received}\\nData Masked: ${issue.data.masked}`;\n\t\t\t}\n\n\t\t\treturn issue.defaultError;\n\t\t},\n\t});\n} catch (err) {\n\tif (err instanceof CpfCnpjError) {\n\t\tif (err.issue.type === 'digits') console.error(err.message);\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperalva%2Fvalidate-cpf-cnpj","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperalva%2Fvalidate-cpf-cnpj","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperalva%2Fvalidate-cpf-cnpj/lists"}