Miss any of our Open RFC calls?Watch the recordings here! »

phone-simplifier

0.1.3 • Public • Published

phone-simplifier

Build Status

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

Install

npm i phone-simplifier

DownloadsWeekly Downloads

1

Version

0.1.3

License

Apache-2.0

Unpacked Size

19.6 kB

Total Files

9

Last publish

Collaborators

  • avatar