phonenumber-formatter
A simple phonenumber formatter for HTML inputs. This package is meant for the front-end, so browserify or webpack will be necessary. It also only currently supports 10-digit numbers.
Installation
npm i phonenumber-formatter -S
Usage
<!-- index.html -->
// app.jsvar formatPhonenumbers =
formatPhonenumbers
takes up to 2 arguments:
- the HTML input element to format
- a function to run after the formatting completes