Spanish Car Plate
Spanish car plate validation
Validación de matriculas de coches en España
Installation
npm i spanish-car-plate
Usage
isValid()
; ; //=> true; //=> true; //=> true // note: old valid plates also returns true === ; //=> true
isOld()
; // one-letter code; //=> true // two-letter code; //=> true // two/three-letter special code (such as ET for army cars and DGP for police cars); //=> true
isSpecial()
Police, Air force, Army, Navy, etc. have special plates.
; ; //=> true; //=> true; //=> true
getCounter()
; ; //=> "BCD"; //=> "CS"
getProvinceName()
It is possible to get the province's name from old plates
; ; //=> "Province of Barcelona"; //=> "Community of Madrid"; //=> "Province of Soria"
getProvinceCode()
It is possible to get the province's code from old plates
; ; //=> "B"; //=> "M"; //=> "SO"
getSpecialCode()
; ; //=> "DGP"
getSpecialName()
; ; //=> "Spanish Police"; //=> "Corps of the Mossos d'Esquadra"
getNumber()
; ; //=> "0001"; //=> "1234"
parse()
Get all the information about the plate
Parse new plate
; ;
Parse old plate
;
Demo
https://spanish-car-plate.netlify.com/
Related
- better-dni - Spanish dni/nif/nie validation
- spain-phone - Spanish phone number validation
Reference
https://en.wikipedia.org/wiki/Vehicle_registration_plates_of_Spain