{"id":17173980,"url":"https://github.com/billinghamj/vrm-node","last_synced_at":"2025-07-04T02:34:09.992Z","repository":{"id":53578859,"uuid":"54217427","full_name":"billinghamj/vrm-node","owner":"billinghamj","description":"Coerces, validates and prettifies vehicle registration marks (VRMs)","archived":false,"fork":false,"pushed_at":"2021-03-23T10:56:22.000Z","size":19,"stargazers_count":6,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-14T23:52:30.578Z","etag":null,"topics":["dvla","javascript","nodejs","vehicle","vrm"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/vrm","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/billinghamj.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":"2016-03-18T16:53:02.000Z","updated_at":"2023-02-28T21:30:01.000Z","dependencies_parsed_at":"2022-09-09T16:30:20.519Z","dependency_job_id":null,"html_url":"https://github.com/billinghamj/vrm-node","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/billinghamj/vrm-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billinghamj%2Fvrm-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billinghamj%2Fvrm-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billinghamj%2Fvrm-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billinghamj%2Fvrm-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/billinghamj","download_url":"https://codeload.github.com/billinghamj/vrm-node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/billinghamj%2Fvrm-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259928197,"owners_count":22933363,"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":["dvla","javascript","nodejs","vehicle","vrm"],"created_at":"2024-10-14T23:52:50.200Z","updated_at":"2025-07-04T02:34:09.973Z","avatar_url":"https://github.com/billinghamj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vrm\n\nCoerces, validates and prettifies vehicle registration marks (VRMs). Presently,\nonly UK DVLA registration plate formats are supported. Please open an issue if\nyou'd like to see support added for other driving authorities' formats - I'd be\nkeen to work with you to enable this.\n\n```js\nimport VRM from 'vrm';\n\nconsole.log(VRM.coerce('Lbo7 se0')); // =\u003e [{ format: 'gb_2001', vrm: 'LB07SEO', prettyVrm: 'LB07 SEO' }]\nconsole.log(VRM.coerce('Lbo7 se0', ['gb_2001'])); // =\u003e [{ format: 'gb_2001', vrm: 'LB07SEO', prettyVrm: 'LB07 SEO' }]\nconsole.log(VRM.coerce('Lbo7 se0', ['gb_1903'])); // =\u003e []\nconsole.log(VRM.info('LB07SEO')); // =\u003e { format: 'gb_2001', vrm: 'LB07SEO', prettyVrm: 'LB07 SEO' }\nconsole.log(VRM.info('LB07SEO', 'gb_2001')); // =\u003e { format: 'gb_2001', vrm: 'LB07SEO', prettyVrm: 'LB07 SEO' }\nconsole.log(VRM.info('LB07SEO', 'gb_1903')); // =\u003e null\n```\n\n## Installation\n\n```bash\n$ npm install vrm\n```\n\n## API\n\n### `VRM.coerce(input[, allowedFormats])`\n\nCoerces the input into a set of possible VRMs which the input could represent.\nSee [more information below](#coercion) about why this is needed.\n\nThe returned array contains the VRM details for each given format, sorted in\norder of likelihood, where the most likely format is the first value.\n\nIf the allowed formats are specified, coercion will be limited to these formats.\nAny other formats will not be checked.\n\nReturns an empty array if the input is invalid or cannot be coerced into any of\nthe formats checked.\n\nThrows if any of the allowed formats are not known.\n\n### `VRM.info(normalizedVRM[, format])`\n\nVerifies that the given VRM matches one of the known formats and returns the\nrelevant VRM details. Only normalized VRMs are accepted.\n\nIf the format is specified, only that format is checked.\n\nReturns null if the VRM does not match any of the formats checked.\n\nThrows if the provided format is not known.\n\n## Notes\n\n### Formats\n\nThe known formats are referenced as the following strings:\n\n- `gb_1903` - `AB 1234` - the first number-plates issued under the \"Motor Car Act\"\n- `gb_1932` - `ABC 123` - after the above format began to run out\n- `gb_1963` - `ABC 123A` - ditto\n- `gb_1983` - `A123 ABC` - ditto\n- `gb_2001` - `AB12 ABC` - the current GB format\n- `ni_1903` - `AZ 1234` - roughly equivalent to `gb_1903`\n- `ni_1966` - `AAZ 1234` - similar to `gb_1932`, the current NI format\n- `diplomatic` - `123 D 123` - used for diplomats (`D`) and accredited personnel (`X`)\n- `military` - `AB 12 AB` - used for military vehicles\n\n### VRM Details\n\nThe VRM details objects returned include the following information:\n\n```js\n{\n\tformat: 'gb_2001', // required, string - format referenced as-above\n\tvrm: 'LB07SEO', // required, string - vrm in upper case, no spaces, no special chars, etc.\n\tprettyVrm: 'LB07 SEO', // optional, string - vrm spaced as legally defined\n}\n```\n\nMore information is likely to be added to this object over time. These changes\nwould not be considered as 'breaking'.\n\n### Coercion\n\nUK registration plates use a particular official typeface which was designed by\nCharles Wright. Bizarrely, it uses exactly the same physical shape for `I` and\n`1`, and for `O` and `0`. This means that the exact VRM can be ambiguous and\npeople often mistype the VRM into forms. Additionally, it presents some\ndifficulties for automatic number plate recognition (ANPR) systems.\n\nThe `coerce` method handles this. It returns an array because (occasionally)\nmultiple formats can be possible.\n\nThe returned array is ordered with the original input first if it is valid,\nfollowed by the other valid options with the newer formats coming first. This\nbehavior could change though, so don't rely on it.\n\n### Possible Additions\n\nIf there is demand for it, two other bits of functionality could be provided:\n\n- normalization: normalizing an arbitrary string input without coercing it (this happens internally anyway)\n- extending `info`: exposing the data contained within a given VRM - e.g. the 2001 UK format contains information about the area and year of registration\n\n### Data Sources\n\n- [PDF from CVPG](http://www.cvpg.co.uk/REG.pdf) - last updated October 2003\n- [Article on Wikipedia](https://en.wikipedia.org/w/index.php?title=Vehicle_registration_plates_of_the_United_Kingdom,_Crown_dependencies_and_overseas_territories\u0026oldid=710572752) - last updated March 2016\n\n## Support\n\nPlease open an issue on this repository.\n\n## Authors\n\n- James Billingham \u003cjames@jamesbillingham.com\u003e\n- adapted from Jack Fransham's original work\n\n## License\n\nMIT licensed - see [LICENSE](LICENSE) file\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillinghamj%2Fvrm-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbillinghamj%2Fvrm-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbillinghamj%2Fvrm-node/lists"}