https://github.com/devfans/parse-phone
phone parser for country dialing code parsing from full string
https://github.com/devfans/parse-phone
Last synced: 6 months ago
JSON representation
phone parser for country dialing code parsing from full string
- Host: GitHub
- URL: https://github.com/devfans/parse-phone
- Owner: devfans
- Created: 2018-01-30T10:41:24.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-25T23:02:23.000Z (about 2 years ago)
- Last Synced: 2025-08-26T03:53:58.563Z (7 months ago)
- Language: JavaScript
- Size: 61.5 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# parse-phone
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
phone parser for international dialing code parsing from full string
## Installation
```
npm install parse-phone
```
## Get Started
```
const phoneStr = "+86188888888"
const parsePhone = require('parse-phone')
const recipient = parsePhone(phoneStr)
{ success: true,
dialCode: '+86',
full: '+86188888888',
phone: '188888888' }
parsePhone('+18096958000')
{ success: true,
dialCode: '+1809',
full: '+18096958000',
phone: '6958000' }
```
[npm-image]: https://img.shields.io/npm/v/parse-phone.svg
[npm-url]: https://npmjs.org/package/parse-phone
[travis-image]: https://img.shields.io/travis/devfans/parse-phone/master.svg
[travis-url]: https://travis-ci.org/devfans/parse-phone
[coveralls-image]: https://img.shields.io/coveralls/devfans/parse-phone/master.svg
[coveralls-url]: https://coveralls.io/r/devfans/parse-phone?branch=master
[downloads-image]: https://img.shields.io/npm/dm/parse-phone.svg
[downloads-url]: https://npmjs.org/package/parse-phone