phonenumber-formatter

1.3.0 • Public • Published

phonenumber-formatter npm version

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.

Live example

Installation

npm i phonenumber-formatter -S

Usage

<!-- index.html -->
<input type="text" id="phonenumber">
// app.js
var formatPhonenumbers = require('phonenumber-formatter')
 
formatPhonenumbers(document.getElementById('phonenumber'))

formatPhonenumbers takes up to 2 arguments:

  1. the HTML input element to format
  2. a function to run after the formatting completes

/phonenumber-formatter/

    Package Sidebar

    Install

    npm i phonenumber-formatter

    Weekly Downloads

    1

    Version

    1.3.0

    License

    MIT

    Last publish

    Collaborators

    • renolc