libphonenumber-umd
v1.0.1
Published
Google's libphonenumber packaged as UMD exposing the `i18n` namespace
Downloads
562
Maintainers
Readme
libphonenumber-umd
Google's libphonenumber packaged as UMD exposing the i18n
namespace
See https://github.com/googlei18n/libphonenumber
Usage
NodeJS module
var libphonenumber = require('libphonenumber-umd');
or AMD
require(['libphonenumber-umd'], function (libphonenumber) {
...
or
<script src="libphonenumber-umd/libphonenumber"></script>
<script>
var libphonenumber = window.i18n;
...
ex:
function format (number) {
var phoneUtil = libphonenumber.phonenumbers.PhoneNumberUtil.getInstance();
number = phoneUtil.parseAndKeepRawInput(number, 'DE');
return phoneUtil.format(number, libphonenumber.phonenumbers.PhoneNumberFormat.E164);
};
format('030 555-555'); // +4930555555