0.0.3 • Published 5 years ago

rf-phone-validator v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

rf-phone-validator

Clean, normalize, validate and format Russian Federation phone numbers.

Install

npm install --save rf-phone-validator

Usage

const PhoneValidator = require('rf-phone-validator');
const phone = new PhoneValidator('8 000 123-4567');

Allowed any phone format.

clean()

console.log(phone.clean()); // 80001234567

normalize()

console.log(phone.normalize()); // 70001234567

valid()

Return true if U can call phone otherwise false

format()

Format phone to the classic '+7 (000) 123-45-67'

formatSpaces()

Format phone to the spases-delimiter '+7 000 123 45 67'

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago