pgroot91 / greece-vehicle-plate

Check that a vehicle registration plate number used in Greece is valid

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

greece-vehicle-plate Build Status Coverage Status npm

Check that a vehicle registration plate number used in Greece is valid.

Installation

$ npm install greece-vehicle-plate

Usage

To validate a plate number:

const plate = require('greece-vehicle-plate');

plate.validate('ΚΥΒ-1050'); // true
plate.validate('ΑΑΑ-1'); // false

Please note that the validation is strict, for example it will not allow spaces. Use clean() to remove any whitespace from a number before validating it:

plate.validate('ΑΒΕ -1234 '); // false
const cleaned = plate.clean('ΑΒΕ -1234 '); // 'ΑΒΕ-1234'
plate.validate(cleaned); // true

License

MIT

About

Check that a vehicle registration plate number used in Greece is valid

License:MIT License


Languages

Language:JavaScript 100.0%