gosnomer
v1.0.1
Published
Gosnomer - Node.js module for standardization of the car license plate of the Russian Federation.
Downloads
1
Maintainers
Readme
Gosnomer
About
Gosnomer - Node.js module for standardization of the car license plate of the Russian Federation.
Installation
$ npm i gosnomer
$ yarn add gosnomer
Docs
- Register the car license plate:
const { LicensePlateRu } = require('gosnomer');
isValid Checks the validity of the car number
const { LicensePlateRu } = require('gosnomer');
const valid = new LicensePlateRu('в042вв 197').isValid()
// <Boolean> true
standart Standardizes a string or outputs an empty one if the number is entered incorrectly
// ✔️
const { LicensePlateRu } = require('gosnomer');
const valid = new LicensePlateRu('в042вв 197').standart()
// <String> "В042ВВ 197"
// ❌
const { LicensePlateRu } = require('gosnomer');
const valid = new LicensePlateRu('в042в 197').standart()
// <String> ""
getInformation information about the number and region of the car number
const { LicensePlateRu } = require('gosnomer');
const valid = new LicensePlateRu('в042вв 197').getInformation()
/* <JSON>
{
isValid: true,
plate: { input: 'в042вв 197', number: 'В042ВВ 197' },
region: { number: '197', name: 'Москва и пригород' }
}
*/