phone-simplifier
v0.1.3
Published
An NPM package for simplifying phone number
Downloads
255
Maintainers
Readme
phone-simplifier
An NPM package for simplifying phone number
The phone number is only formated basing on North America (+1) at the moment.
Installation
Install using npm.
npm install phone-simplifier
Usage
Simplify your phone number
const phone = require('phone-simplifier')
let simplifiedPhoneNumber = phone.simplify('phone-number-string');
Examples:
+1 (234) 567-8910 => +1 (234) 567-8910
+12345678910 => (234) 567-8910
2345678910 => (234) 567-8910
234-567-8910 => (234) 567-8910
<empty or special characters> => <empty string>
Get clean phone number
const phone = require('phone-simplifier')
let simplifiedPhone = phone.clean('phone-number-string');
Examples:
+1 (234) 567-8910 => +12345678910
234-567-8910 => 2345678910
Contributions
Feel free to report bugs and make feature requests in the Issue Tracker, fork and create pull requests!
LICENSE
Apache License 2.0