https://github.com/dalenguyen/phone-simplifier
An NPM package for simplifying phone number
https://github.com/dalenguyen/phone-simplifier
npm npm-package phone phone-format phone-number phonenumber
Last synced: about 2 months ago
JSON representation
An NPM package for simplifying phone number
- Host: GitHub
- URL: https://github.com/dalenguyen/phone-simplifier
- Owner: dalenguyen
- License: apache-2.0
- Created: 2018-05-16T15:39:04.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-10-05T20:49:51.000Z (over 4 years ago)
- Last Synced: 2025-09-27T23:54:38.358Z (9 months ago)
- Topics: npm, npm-package, phone, phone-format, phone-number, phonenumber
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/phone-simplifier
- Size: 12.7 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phone-simplifier
[](https://travis-ci.org/dalenguyen/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__](https://www.npmjs.com/).
```sh
npm install phone-simplifier
```
## Usage
### Simplify your phone number
```sh
const phone = require('phone-simplifier')
let simplifiedPhoneNumber = phone.simplify('phone-number-string');
```
Examples:
```sh
+1 (234) 567-8910 => +1 (234) 567-8910
+12345678910 => (234) 567-8910
2345678910 => (234) 567-8910
234-567-8910 => (234) 567-8910
=>
```
### Get clean phone number
```sh
const phone = require('phone-simplifier')
let simplifiedPhone = phone.clean('phone-number-string');
```
Examples:
```sh
+1 (234) 567-8910 => +12345678910
234-567-8910 => 2345678910
```
## Contributions
Feel free to report bugs and make feature requests in the [Issue Tracker](https://github.com/dalenguyen/phone-simplifier/issues), fork and create pull requests!
## LICENSE
Apache License 2.0