gosnomer
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i gosnomer

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

77.9 kB

Total Files

23

Last publish

Collaborators

  • vivers