GithubHelp home page GithubHelp logo

kmuenze / phoneformat.js Goto Github PK

View Code? Open in Web Editor NEW

This project forked from albeebe/phoneformat.js

0.0 1.0 0.0 4.39 MB

Javascript Phone Number Formatter

License: MIT License

JavaScript 99.97% HTML 0.03%

phoneformat.js's Introduction

PhoneFormat.js

A javascript phone formatter

Install

via Bower

bower install phoneformat.js

via NPM

npm install phoneformat.js

All files for usage are in the /dist directory.

  • Amd:
    • phone-format-amd.js or phone-format-amd.min.js
  • Exports:
    • phone-format-exports.js or phone-format-amd.min.js
  • Global:
    • phone-format-global.js or phone-format-global.min.js
  • Original Blend:
    • phone-format.js or phone-format.min.js

API

Function Parameters Example
countryForE164Number phoneNumber : string phoneFormat.countryForE164Number(validInternationalPhoneNumber);
formatNumberForMobileDialing countryCode : string, phoneNumber : string phoneFormat.formatNumberForMobileDialing(countryCode, validPhoneNumber);
isValidNumber phoneNumber : string, countryCode : string phoneFormat.isValidNumber(validPhoneNumber, countryCode);
formatE164 countryCode: string, phoneNumber : string phoneFormat.formatE164(countryCode, validPhoneNumber);
formatInternational countryCode : string, phoneNumber : string phoneFormat.formatInternational(countryCode, validPhoneNumber);
formatLocal countryCode : string, phoneNumber : string phoneFormat.formatLocal(countryCode, validPhoneNumber);
exampleLandlineNumber countryCode : string phoneFormat.exampleLandlineNumber(countryCode);
exampleMobileNumber countryCode : string phoneFormat.exampleMobileNumber(countryCode);
cleanPhone phoneNumber : string phoneFormat.cleanPhone(validPhoneNumber);
countryCodeToName countryCode : string phoneFormat.countryCodeToName(countryCode);

FAQ

Is PhoneFormat.js in sync with the latest libphonenumber?

More often then not PhoneFormat.js will NOT be using the latest version of libphonenumber.

It was last synced v8.10.6

If this is causing you any headaches, please follow the instructions below to update the source files in /lib.

  • Step 1

    • Copy to your clipboard, the contents of closure.txt at the top of this page
  • Step 2

  • Step 3

    • Paste the contents of closure.txt into the big textarea on the left side of the screen under the Compile button.
    • Make sure you delete whatever text is already the textarea!
    • After you've pasted it press the Compile button
    • If everything works correctly, on the right side of the screen will be a freshly compiled google-libraries.js
  • Step 4

    • Update lib/google-libraries.js with the compiled libraries from the compiler service.
    • Run npm run build
    • Commit your change, push it up and submit a pull request.
    • Thank you!

Questions?

This project was created by @albeebe.

phoneformat.js's People

Contributors

sturdynut avatar albeebe avatar andidev avatar jordaaash avatar igloczek avatar clockwerx avatar mwilk21 avatar dolfelt avatar marcdelalonde avatar theblang avatar nicudine avatar pbechu avatar thiagolimaaurea avatar tylergraf avatar kmuenze avatar ra00l avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.