{"id":23544020,"url":"https://github.com/rowellx68/valid-nhsnum","last_synced_at":"2026-03-11T03:31:13.985Z","repository":{"id":42625797,"uuid":"397714431","full_name":"rowellx68/valid-nhsnum","owner":"rowellx68","description":"Validate NHS Numbers using the 11 modulo method. You can also generate NHS Numbers for testing.","archived":false,"fork":false,"pushed_at":"2025-09-11T06:11:37.000Z","size":1120,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-14T06:29:31.552Z","etag":null,"topics":["nhs","nhs-number","testing","validation"],"latest_commit_sha":null,"homepage":"https://rowellx68.github.io/valid-nhsnum/","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/rowellx68.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":"2021-08-18T19:30:57.000Z","updated_at":"2025-04-23T19:46:35.000Z","dependencies_parsed_at":"2025-04-24T00:37:49.653Z","dependency_job_id":null,"html_url":"https://github.com/rowellx68/valid-nhsnum","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/rowellx68/valid-nhsnum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowellx68%2Fvalid-nhsnum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowellx68%2Fvalid-nhsnum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowellx68%2Fvalid-nhsnum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowellx68%2Fvalid-nhsnum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rowellx68","download_url":"https://codeload.github.com/rowellx68/valid-nhsnum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rowellx68%2Fvalid-nhsnum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30369379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["nhs","nhs-number","testing","validation"],"created_at":"2024-12-26T07:13:10.876Z","updated_at":"2026-03-11T03:31:13.963Z","avatar_url":"https://github.com/rowellx68.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# valid-nhsnum\n\n![MIT](https://img.shields.io/badge/License-MIT-green?style=flat-square)\n![CI](https://img.shields.io/github/actions/workflow/status/rowellx68/valid-nhsnum/publish.yml?style=flat-square\u0026label=Build%20and%20Publish)\n\u003ca href=\"https://www.npmjs.com/package/valid-nhsnum\"\u003e\n![NPM](https://img.shields.io/npm/v/valid-nhsnum?style=flat-square\u0026label=Version)\n\u003c/a\u003e\n\nA zero dependency NHS Number validator and generator.\n\n## Demo\n\nTry the demo [here](https://rowellx68.github.io/valid-nhsnum/).\n\n## Installation\n\n```bash\npnpm i valid-nhsnum\n```\n\n## API\n\n#### `validate(value: string): boolean`\n\nThis method accepts a string and returns a boolean signifying the value's validity.\n\n```ts\nimport { validate } from 'valid-nhsnum';\n\n// true\nvalidate('098 357 6548');\n```\n\n\n#### `generate(count: number, formatted?: boolean): string[]`\n\nThis method is useful for generating a list of NHS numbers that can be used for testing.\n\nIt has an optional boolean parameter that pre-formats the NHS numbers if `true` is passed in.\n\n```ts\nimport { generate } from 'valid-nhsnum';\n\n// ['035 469 6505', '082 379 5578']\ngenerate(2, true);\n\n// ['0354696505', '0823795578']\ngenerate(2);\n```\n\n\n#### `generateOne(formatted?: boolean): string`\n\nThis method generates a single NHS number with an optional boolean parameter that if set to `true` would format the string.\n\n```ts\nimport { generateOne } from 'valid-nhsnum';\n\n// '082 379 5578'\ngenerateOne(true);\n\n// '0823795578'\ngenerateOne();\n```\n\n## Links\n\n- [NHS number format](https://en.wikipedia.org/wiki/NHS_number#Format)\n- [What is an NHS number?](https://www.nhs.uk/using-the-nhs/about-the-nhs/what-is-an-nhs-number/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frowellx68%2Fvalid-nhsnum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frowellx68%2Fvalid-nhsnum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frowellx68%2Fvalid-nhsnum/lists"}