msisdn-formatter

1.1.0 • Public • Published

msisdn-formatter

Build Status codecov Dependencies

Two simple function to normalize and format msisdn.

Install

$ npm install msisdn-formatter --save

Usage

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.

Readme

Keywords

Package Sidebar

Install

npm i msisdn-formatter

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

211 kB

Total Files

6

Last publish

Collaborators

  • dalee-user
  • ns3777k