Skip to content

Vivers0/gosnomer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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: 'Москва и пригород' }
} 
*/

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published