greece-vehicle-plate

1.0.0 • Public • Published

greece-vehicle-plate Build Status Coverage Status

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

Package Sidebar

Install

npm i greece-vehicle-plate

Weekly Downloads

2

Version

1.0.0

License

MIT

Last publish

Collaborators

  • alefteris