npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@imaginemyride/licence-plate

v0.1.0

Published

As-you-type formatting and validation for European and neighbouring-country licence plates

Readme

@imaginemyride/licence-plate

As-you-type formatting and structural validation for ordinary passenger-car licence plates from 27 countries.

npm install @imaginemyride/licence-plate

The package is ESM-only, supports Node.js 24 and newer, and uses ASCII Latin letters and digits for both input and output.

Formatting

Formatter is synchronous and stateless. Pass the complete current input value on every change.

import { Formatter } from "@imaginemyride/licence-plate";

const formatter = new Formatter("FR");

formatter.formatString("a"); // "A"
formatter.formatString("ab"); // "AB-"
formatter.formatString("ab1"); // "AB-1"
formatter.formatString("ab123"); // "AB-123-"
formatter.formatString("ab123cd"); // "AB-123-CD"

Separators appear as soon as every format still compatible with the input agrees that a group has ended. Ambiguous compact values are not guessed. For example, a German district may contain one to three letters, so an explicit district separator is required while the value remains ambiguous:

const formatter = new Formatter("DE");

formatter.formatString("B"); // "B"
formatter.formatString("B-"); // "B-"
formatter.formatString("B-AB1234"); // "B-AB1234"

Validation

Create validators asynchronously. The factory initialises the shared WebAssembly dependency when the selected country uses it.

import { Validator, init } from "@imaginemyride/licence-plate";

await init(); // Optional eager initialisation during application start-up.

const validator = await Validator.create("FR");
validator.validateString("ab123cd"); // true
validator.validateString("AB-123-CD"); // true
validator.validateString("AB--123-CD"); // false

init() is idempotent, and concurrent calls share the same operation. validateString() is synchronous after the factory resolves.

Supported countries

| Code | Country | Ordinary format families | | ---- | -------------- | ---------------------------------------------------- | | NL | Netherlands | Dutch sidecodes 1-11 | | DE | Germany | District, serial letters and digits | | BE | Belgium | Current numeric-prefix format | | GB | United Kingdom | Current Great Britain format | | FR | France | Current SIV format | | IT | Italy | Current national format | | GR | Greece | Current three-letter format | | BG | Bulgaria | Current regional formats | | RS | Serbia | Current regional formats | | TR | Turkey | Current province formats | | NO | Norway | Current two-letter format | | SE | Sweden | Current numeric and final-letter formats | | ES | Spain | Current national format | | AL | Albania | Current national format | | XK | Kosovo | Current regional format | | IR | Iran | Latin-token representation of current private format | | IQ | Iraq | Latin representation of current unified format | | LU | Luxembourg | Current two-letter format | | CH | Switzerland | Current canton format | | RO | Romania | Current county and Bucharest formats | | HU | Hungary | Current and preceding national formats | | AT | Austria | Current district formats | | SI | Slovenia | Current regional format families | | SK | Slovakia | Current national format | | HR | Croatia | Current regional formats | | UA | Ukraine | Current regional format | | RU | Russia | Current two- and three-digit region formats |

The exported CountryCode type and countryCodes tuple contain this exact set. Runtime calls with another country throw RangeError.

Scope

Validation confirms that a value matches a supported ordinary passenger registration format. It does not prove that a registration was issued, is active, or belongs to a particular vehicle. Issued-series and reservation data require a national registry lookup.

Diplomatic, military, temporary, dealer, motorcycle, vanity and other special plates are outside the package's scope. Historical formats are included only where the supported family is explicitly listed above.

Countries that normally print Greek, Cyrillic, Arabic or Persian characters use documented ASCII visual aliases or tokens. The formatter does not accept native-script input or perform lossy phonetic transliteration.

Licence

MIT