0.0.6 • Published 5 years ago

@sturdynut/i18n-phone-formatter v0.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

Storage Poly | CircleCI Coverage Status

A Javascript phone number formatter that uses google's i18n library.

Requirements

  • Node 6+

Install

yarn add @sturdynut/i18n-phone-formatter or npm install @sturdynut/i18n-phone-formatter -S

Usage

import {
  formatE164
} from '@sturdynut/i18n-phone-formatter'; // or require('@sturdynut/i18n-phone-formatter')


formatE164('US', '4155552671'); // +14155552671

API

FunctionParametersExample
countryForE164NumberphoneNumber : stringphoneFormat.countryForE164Number(validInternationalPhoneNumber);
formatNumberForMobileDialingcountryCode : string, phoneNumber : stringphoneFormat.formatNumberForMobileDialing(countryCode, validPhoneNumber);
isValidNumberphoneNumber : string, countryCode : stringphoneFormat.isValidNumber(validPhoneNumber, countryCode);
formatE164countryCode: string, phoneNumber : stringphoneFormat.formatE164(countryCode, validPhoneNumber);
formatInternationalcountryCode : string, phoneNumber : stringphoneFormat.formatInternational(countryCode, validPhoneNumber);
formatLocalcountryCode : string, phoneNumber : stringphoneFormat.formatLocal(countryCode, validPhoneNumber);
exampleLandlineNumbercountryCode : stringphoneFormat.exampleLandlineNumber(countryCode);
exampleMobileNumbercountryCode : stringphoneFormat.exampleMobileNumber(countryCode);
cleanPhonephoneNumber : stringphoneFormat.cleanPhone(validPhoneNumber);
countryCodeToNamecountryCode : stringphoneFormat.countryCodeToName(countryCode);

Questions?

@sturdynut

Bugs?

Submit a bug

License

This project is distributed under the MIT license.

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago