@toluwap/phone-number-formatter
TypeScript icon, indicating that this package has built-in type declarations

2.1.3 • Public • Published

Phone Number Formatter

🧐 About

Format any valid Nigeria number into an international format.

Installing

$ npm install @toluwap/phone-number-formatter --save

Usage

const { convertNigeriaPhoneNumberToInternationFormat } = require('@toluwap/phone-number-formatter');
import { convertNigeriaPhoneNumberToInternationFormat } from '@toluwap/phone-number-formatter';
//using array of phoneNumbers
const phoneNumbers = ['08012345678', '2348102345678', '07012345678', '+23481098765432'];

const phoneNumbers1 = convertNigeriaPhoneNumberToInternationFormat({phoneNumbers: phoneNumbers});
// ['2348012345678', '2348102345678', '2347012345678', '23481098765432']

//adding prepend to the numbers
const phoneNumbers1 = convertNigeriaPhoneNumberToInternationFormat({phoneNumbers: phoneNumbers, options: { prepend: '+'}});
//['+2348012345678', '+2348102345678', '+2347012345678', '+23481098765432']

Package Sidebar

Install

npm i @toluwap/phone-number-formatter

Weekly Downloads

1

Version

2.1.3

License

ISC

Unpacked Size

4.71 kB

Total Files

4

Last publish

Collaborators

  • toluwap