{"id":27302398,"url":"https://github.com/steinathan/ngn-phone-util","last_synced_at":"2025-10-04T09:16:39.816Z","repository":{"id":56240034,"uuid":"223263958","full_name":"steinathan/ngn-phone-util","owner":"steinathan","description":"This module is used to validate and test nigerian phone numbers","archived":false,"fork":false,"pushed_at":"2020-11-18T22:29:40.000Z","size":292,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T02:39:02.094Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/steinathan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code-of-conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-21T20:55:39.000Z","updated_at":"2019-11-21T21:09:46.000Z","dependencies_parsed_at":"2022-08-15T15:11:23.000Z","dependency_job_id":null,"html_url":"https://github.com/steinathan/ngn-phone-util","commit_stats":null,"previous_names":["steinathan/ngn-phone-util"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinathan%2Fngn-phone-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinathan%2Fngn-phone-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinathan%2Fngn-phone-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/steinathan%2Fngn-phone-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/steinathan","download_url":"https://codeload.github.com/steinathan/ngn-phone-util/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248507239,"owners_count":21115562,"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":"2025-04-12T02:39:01.200Z","updated_at":"2025-10-04T09:16:34.773Z","avatar_url":"https://github.com/steinathan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ngn-phone-util\n\n\u003e Nigerian Phone Number Utility\n\nThis module is used validate and test for nigerian phone numbers\n\n### Usage\n\n```bash\nnpm install ngn-phone-util\n```\n\n### Features\n\n- Auto detect phone number provider and..\n- Auto test and validate phone number\n\n### Importing library from nodejs\n\nYou can import the generated bundle to use the whole library generated by script:\n\n```javascript\nimport { test, detect } from 'ngn-phone-util';\n\nlet phone = '09031844110';\ntest(phone); // =\u003e true | throws \"Error\"\n\n// Detect a phone number\nlet ph = '09031844110';\ndetect(ph); // =\u003e \"MTN\"\n```\n\n### Importing library for the browser\n\n```html\n\u003cscript src=\"https://cdn.jsdelivr.net/navicstein/ngn-phone-util/dist/ngn-phone-util.umd.js\"\u003e\u003c/script\u003e\n\n\u003cscript\u003e\n  let phoneIsValid = ngnPhoneUtil.test('09031844110');\n  if (phoneIsValid) {\n    // do something with phone\n  }\n\u003c/script\u003e\n```\n\nAdditionally, you can import the transpiled modules from `dist/lib` in case you have a modular library:\n\n```typescript\nimport validate from 'ngn-phone-util/dist/lib/validate';\nvalidate(phone: string)\n```\n\n### NPM scripts\n\n- `npm t`: Run test suite\n- `npm start`: Run `npm run build` in watch mode\n- `npm run test:watch`: Run test suite in [interactive watch mode](http://facebook.github.io/jest/docs/cli.html#watch)\n- `npm run test:prod`: Run linting and generate coverage\n- `npm run build`: Generate bundles and typings, create docs\n- `npm run lint`: Lints code\n- `npm run commit`: Commit using conventional commit style ([husky](https://github.com/typicode/husky) will tell you to use it if you haven't :wink:)\n\n### Todo\n\n- Add a `.format()` function to auto add `+234` to numbers as a serialized argin.\n- Add a `generator` function to randomly generate specific provider numbers.\n\nThis project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteinathan%2Fngn-phone-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsteinathan%2Fngn-phone-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsteinathan%2Fngn-phone-util/lists"}