{"id":21690492,"url":"https://github.com/theuves/cpf","last_synced_at":"2025-04-10T02:21:11.916Z","repository":{"id":54443295,"uuid":"48662406","full_name":"theuves/cpf","owner":"theuves","description":"Library to handle Brazilian CPF numbers.","archived":false,"fork":false,"pushed_at":"2024-05-07T19:22:08.000Z","size":718,"stargazers_count":60,"open_issues_count":3,"forks_count":14,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T22:30:00.569Z","etag":null,"topics":["brasil","brazil","cpf","cpf-formate","cpf-generator","cpf-mask","cpf-validador","cpf-validate","cpf-validation","cpf-validator","number","numbers"],"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/theuves.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":"theuves"}},"created_at":"2015-12-27T22:13:09.000Z","updated_at":"2025-02-15T15:22:56.000Z","dependencies_parsed_at":"2024-06-18T15:22:05.554Z","dependency_job_id":"34eea156-2499-4011-8c35-3d70e8ef7ba6","html_url":"https://github.com/theuves/cpf","commit_stats":{"total_commits":142,"total_committers":6,"mean_commits":"23.666666666666668","dds":"0.38732394366197187","last_synced_commit":"6304adb7e95e6f3fc6e4bdbcef6326dc208ea00c"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theuves%2Fcpf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theuves%2Fcpf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theuves%2Fcpf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theuves%2Fcpf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theuves","download_url":"https://codeload.github.com/theuves/cpf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248143110,"owners_count":21054709,"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":["brasil","brazil","cpf","cpf-formate","cpf-generator","cpf-mask","cpf-validador","cpf-validate","cpf-validation","cpf-validator","number","numbers"],"created_at":"2024-11-25T17:31:22.952Z","updated_at":"2025-04-10T02:21:11.889Z","avatar_url":"https://github.com/theuves.png","language":"JavaScript","funding_links":["https://github.com/sponsors/theuves"],"categories":[],"sub_categories":[],"readme":"# `cpf`\n\n\u003e Functions to handle Brazilian CPF numbers\n\n![Status](https://travis-ci.org/theuves/cpf.svg?branch=master)\n\n***\n**Precisando de um desenvolvedor? Entre em contato: theuves@gmail.com**\n***\n\n## Installation\n\nYou can install it with *npm* or *yarn*.\n\nTry:\n\n- *npm*: `npm install cpf`\n- *yarn*: `yarn add cpf`\n\n## Usage\n\n```js\nconst CPF = require('cpf');\n```\n\nNow, `CPF` is a object with some functions:\n\n- `format`\n- `generate`\n- `isValid`\n\n### `CPF.format(cpf)`\n\n\u003e Format a CPF number.\n\n#### Example\n\n```js\nCPF.format('11144477735');\n//=\u003e '111.444.777-35'\n```\n\n#### Parameters\n\n- `cpf` {*string*} A CPF number.\n\nReturns a string with the formatted CPF number.\n\n### `CPF.generate(formatted, invalid)`\n\n\u003e Generate a random CPF number.\n\n#### Parameters\n\n- `formatted` {*boolean*} `true` by default. It will generate a formatted CPF number.\n- `invalid` {*boolean*} `false` by default. It will generate a invalid CPF number.\n\nReturns a CPF number.\n\n### `CPF.isValid(cpf, byLength)`\n\n\u003e Check if a CPF number is valid.\n\n#### Example\n\n```js\nCPF.isValid('111.444.777-35');\n// true\n\nCPF.isValid('111.444.777-42');\n// false\n\nCPF.isValid('111.444.777-42', true);\n// true\n\nCPF.isValid('111.444.777', true);\n// false\n```\n\n#### Parameters\n\n- `cpf` {*string*} Check if the CPF number is valid.\n- `byLength` {*boolean*} `false` by default. Check only if the length is valid.\n\nReturns the check result.\n\n## License\n\nMIT \u0026copy; Matheus Alves\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheuves%2Fcpf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheuves%2Fcpf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheuves%2Fcpf/lists"}