{"id":28164036,"url":"https://github.com/patrickpissurno/node-telefone","last_synced_at":"2025-05-15T11:15:26.352Z","repository":{"id":34933155,"uuid":"192532270","full_name":"patrickpissurno/node-telefone","owner":"patrickpissurno","description":"Biblioteca para validar facilmente telefones brasileiros","archived":false,"fork":false,"pushed_at":"2025-01-26T01:55:24.000Z","size":280,"stargazers_count":13,"open_issues_count":2,"forks_count":8,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-05-02T09:51:05.740Z","etag":null,"topics":["br","brasil","brazil","easy","formatar","javascript","nodejs","phone","telefone","validar","validate"],"latest_commit_sha":null,"homepage":null,"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/patrickpissurno.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}},"created_at":"2019-06-18T12:06:24.000Z","updated_at":"2025-01-26T01:55:27.000Z","dependencies_parsed_at":"2025-02-26T16:10:34.102Z","dependency_job_id":"9b10469a-bf87-4c77-9497-05e76d717b42","html_url":"https://github.com/patrickpissurno/node-telefone","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fnode-telefone","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fnode-telefone/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fnode-telefone/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickpissurno%2Fnode-telefone/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickpissurno","download_url":"https://codeload.github.com/patrickpissurno/node-telefone/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253895381,"owners_count":21980523,"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":["br","brasil","brazil","easy","formatar","javascript","nodejs","phone","telefone","validar","validate"],"created_at":"2025-05-15T11:15:00.942Z","updated_at":"2025-05-15T11:15:26.328Z","avatar_url":"https://github.com/patrickpissurno.png","language":"JavaScript","readme":"# telefone\n[![npm-version](https://img.shields.io/npm/v/telefone.svg)](https://www.npmjs.com/package/telefone)\n[![coverage status](https://coveralls.io/repos/github/patrickpissurno/node-telefone/badge.svg?branch=master)](https://coveralls.io/github/patrickpissurno/node-telefone?branch=master)\n[![known vulnerabilities](https://snyk.io/test/github/patrickpissurno/node-telefone/badge.svg)](https://snyk.io/test/github/patrickpissurno/node-telefone)\n[![downloads](https://img.shields.io/npm/dt/telefone.svg)](https://www.npmjs.com/package/telefone)\n[![license](https://img.shields.io/github/license/patrickpissurno/node-telefone.svg?maxAge=1800)](https://github.com/patrickpissurno/node-telefone/blob/master/LICENSE)\n\nBiblioteca para validar e formatar facilmente telefones brasileiros\n\nO objetivo desta biblioteca é ser leve e oferecer métodos simples e garantidos para validação e formatação básica de telefones brasileiros. \n\n## Install\n\n```\nnpm i telefone\n```\n\n## Como importar\n\n```js\nconst parse = require('telefone/parse');\n// ou\nconst { parse } = require('telefone');\n// ou\nconst parse = require('telefone').parse;\n\nconst format = require('telefone/format');\n// ou\nconst { format } = require('telefone');\n// ou\nconst format = require('telefone').format;\n```\n\n## parse(str)\n\n```js\nconst parse = require('telefone/parse');\nconsole.log(parse(\"+55 (21) 97864-2213\")); //retorna 21978642213\nconsole.log(parse(\"(21) 00000-0000\")); //retorna null, pois o telefone é inválido\nconsole.log(parse(\"+55 (21) 97864-2213\", { apenasFixo: true })); //retorna null, pois o telefone não é fixo\nconsole.log(parse(\"+55 (21) 4002-8922\", { apenasCelular: true })); //retorna null, pois o telefone não é celular\nconsole.log(parse(\"+55 (21) 4002-8922\", { apenasDDD: [ '11', '24' ] })); //retorna null, pois o telefone não é de um dos DDDs informados\n```\n\n## format(str)\n\n```js\nconst format = require('telefone/format');\nconsole.log(format(\"+55 2197864 2213\")); //retorna (21) 97864-2213\nconsole.log(format(\"+5521 4002 8922\")); //retorna (21) 4002-8922\nconsole.log(format(\"2140028922\")); //retorna (21) 4002-8922\n```\n\n## Posso usar em produção?\nDeve. Essa biblioteca tem uma política estrita de 100% de cobertura. Além disso, ela tem sido usada internamente em produção desde 2019.\n\n## Licença\n\nMIT License\n\nCopyright (c) 2019-2025 Patrick Pissurno\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickpissurno%2Fnode-telefone","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickpissurno%2Fnode-telefone","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickpissurno%2Fnode-telefone/lists"}