@toluwap/phone-number-formatter
v2.1.3
Published
convert any valid Nigeria phone number to international format
Downloads
4
Maintainers
Readme
🧐 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']