@imranshad/phoneformatter
v1.0.3
Published
Country code formatter
Downloads
8
Readme
How to install
yarn add @imranshad/phoneformatter or
npm install @imranshad/phoneformatter
Example
app.js
const { phoneFormatter } = require("@imranshad/phoneformatter");
console.warn(phoneFormatter("12345678901")) //+1-234-567-8901
console.warn(phoneFormatter("+12345678901")) //+1-234-567-8901
Usage detail
- phoneformatter function will throw error if length of the phone go below 10 or above 14
- phoneformatter function will append "+"" before country code if the length of the phone number is greater than 10
- This npm package will use "-" as separator