{"id":21197316,"url":"https://github.com/dvx/fonz.js","last_synced_at":"2025-07-10T05:31:29.340Z","repository":{"id":57239904,"uuid":"89312173","full_name":"dvx/fonz.js","owner":"dvx","description":"A node library that accurately validates phone numbers.","archived":false,"fork":false,"pushed_at":"2017-04-30T19:03:51.000Z","size":11,"stargazers_count":30,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-05T17:48:21.006Z","etag":null,"topics":[],"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/dvx.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":"2017-04-25T03:14:17.000Z","updated_at":"2023-08-16T15:22:47.000Z","dependencies_parsed_at":"2022-08-30T00:11:30.231Z","dependency_job_id":null,"html_url":"https://github.com/dvx/fonz.js","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvx%2Ffonz.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvx%2Ffonz.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvx%2Ffonz.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dvx%2Ffonz.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dvx","download_url":"https://codeload.github.com/dvx/fonz.js/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225623031,"owners_count":17498167,"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":[],"created_at":"2024-11-20T19:43:28.711Z","updated_at":"2024-11-20T19:43:29.158Z","avatar_url":"https://github.com/dvx.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"fonz.js\n=========\n\n[![Build Status](https://travis-ci.org/dvx/fonz.js.svg?branch=master)](https://travis-ci.org/dvx/fonz.js)\n\nA node library that accurately validates phone numbers. It tries its best to abide by NANPA standards, but international numbers are not yet supported.\n\n### Why fonz.js?\nFonz.js validates whether or not an input is a valid North American phone number according to the [North American Numbering Plan Administration](https://www.nationalnanpa.com/index.html). It verifies area codes, exchange codes, and station codes. To do this verification, all non-numeric characters are stripped. In some cases, results are better than Google's libphonenumber. For example, the following (correctly) do not pass validation using fonz.js:\n\n- 310-911-1234\n- 770-555-0150\n- 949-411-0110\n- 770-555-1212\n\nOther validators incorrectly mark them as valid. To read more about how and why fonz.js was written, check out the blog post [here](https://dvt.name/2017/04/25/fonz-js-a-better-phone-verification-library/).\n\n## Installation\n\n  `npm install fonz.js`\n\n## Usage\n\n    var fonz = require('fonz.js');\n\n    if (fonz.validate('123-456-7890')) {\n      // this will fail validation as 123 is an invalid area code\n    }\n    \n    \n  Non-numeric characters are stripped:\n  \n    // this is fine!\n    if (fonz.validate('xyz-4-0-4-|-4-5-6-!-7-8-9-0-abc-')) { \n      // this is a valid number!\n    }\n    \n  Leading with a the valid country code of `1` is perfectly acceptable:\n  \n    if (fonz.validate(13104439021)) { \n      // this is a valid number!\n    }\n  \n  The `validate()` function will always return `true` or `false`.\n\n\n## Tests\n\n  `npm test`\n\n\n## Contributing\n\nFeel free to contribute! Bug fixes or new features are always welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvx%2Ffonz.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdvx%2Ffonz.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdvx%2Ffonz.js/lists"}