parse-phone
Version:
phone string parser
44 lines (33 loc) • 1.17 kB
Markdown
[![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
```
npm install parse-phone
```
```
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' }
```
[]: https://img.shields.io/npm/v/parse-phone.svg
[]: https://npmjs.org/package/parse-phone
[]: https://img.shields.io/travis/devfans/parse-phone/master.svg
[]: https://travis-ci.org/devfans/parse-phone
[]: https://img.shields.io/coveralls/devfans/parse-phone/master.svg
[]: https://coveralls.io/r/devfans/parse-phone?branch=master
[]: https://img.shields.io/npm/dm/parse-phone.svg
[]: https://npmjs.org/package/parse-phone