https://github.com/holyshared/phone-number-jp
The phone number splitter for Japanese
https://github.com/holyshared/phone-number-jp
Last synced: about 1 year ago
JSON representation
The phone number splitter for Japanese
- Host: GitHub
- URL: https://github.com/holyshared/phone-number-jp
- Owner: holyshared
- License: mit
- Created: 2015-11-18T02:49:36.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-08-24T07:31:07.000Z (almost 10 years ago)
- Last Synced: 2025-06-07T08:35:11.635Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 27.3 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# phone-number-jp
[](https://badge.fury.io/js/phone-number-jp)
[](https://travis-ci.org/holyshared/phone-number-jp)
[](https://codecov.io/gh/holyshared/phone-number-jp)
[](https://david-dm.org/holyshared/phone-number-jp)
## Installation
npm install phone-number-jp
## Basic usage
You can split the phone number.
```js
import splitter from 'phone-number-jp';
const results = splitter.split('0768223333');
console.log(results[0]); // 0768
console.log(results[1]); // 22
console.log(results[2]); // 3333
```
You can format the phone number.
```js
import splitter from 'phone-number-jp';
const result = splitter.format('0768223333');
console.log(result); // 0768-22-3333
```
## Run the test
npm install
npm run instrument
npm test