@loadsmart/utils-phone-number

useful functions for manipulating phone numbers

Usage no npm install needed!

<script type="module">
  import loadsmartUtilsPhoneNumber from 'https://cdn.skypack.dev/@loadsmart/utils-phone-number';
</script>

README

BundlePhobia BundlePhobia

utils-phone-number

useful functions for manipulating phone numbers

Install via NPM

$ npm i @loadsmart/utils-phone-number --save

Install via yarn

$ yarn add @loadsmart/utils-phone-number

Usage

import React from 'react'

import { format } from '@loadsmart/utils-phone-number'

const phone = '+12345678910'
const mask = '+X (XXX) XXX-XXXX'

export default () => (
  <div>
    formatted: {format(phone, mask)}, should render: (+1 (234) 567-8910)
  </div>
)