https://github.com/dalee/msisdn-formatter
Russian msisdn normalizer and formatter
https://github.com/dalee/msisdn-formatter
msisdn msisdn-formatter russian russian-specific
Last synced: about 1 year ago
JSON representation
Russian msisdn normalizer and formatter
- Host: GitHub
- URL: https://github.com/dalee/msisdn-formatter
- Owner: Dalee
- License: mit
- Created: 2016-06-25T23:30:05.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-17T19:12:26.000Z (over 6 years ago)
- Last Synced: 2025-06-15T20:50:32.142Z (about 1 year ago)
- Topics: msisdn, msisdn-formatter, russian, russian-specific
- Language: JavaScript
- Size: 107 KB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# msisdn-formatter
[](https://travis-ci.org/Dalee/msisdn-formatter)
[](https://codecov.io/gh/Dalee/msisdn-formatter)
[](https://david-dm.org/Dalee/msisdn-formatter)
Two simple function to normalize and format msisdn.
## Install
```
$ npm install msisdn-formatter --save
```
## Usage
```js
import { clean, pretty } from 'msisdn-formatter';
const userNumber = '+7 926 000-00-00';
console.log(clean(userNumber)); // Prints: '9260000000'
console.log(pretty(userNumber, 'full')); // Prints: '+7 (926) 000-0000'
```
Available formats:
- clean: *79260000000*
- cleaner: *9260000000*
- short: *926 000-0000*
- usual: *(926) 000-0000*
- full: *+7 (926) 000-0000*
The library is built to support AMD, CommonJS and globals.