NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm, #1953 most downloaded on npm
A simpler (and smaller) rewrite of Google Android's libphonenumber library in javascript
Latest stable
1.13.17
Last release 9 days ago
19 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Most releases are documented
notes for 38 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
460 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Nothing published for this version
Added extract: false option on parsePhoneNumberFromString(): it enables a bit "stricter" parsing in a way that it attempts to parse the entire text as
Added extract: false option on parsePhoneNumberFromString(): it enables a bit "stricter" parsing in a way that it attempts to parse the entire text as a phone number rather than extracting a phone number from text. For example, with extract: false option, "(213) 373-4253" is parsed as a valid phone number, but "Call: (213) 373-4253" is not, because the "Call: " part doesn't automatically get trimmed in this case. If there's version 2.x, I guess extract: false will be the default behavior because it looks more appropriate than the default "extract" behavior of Google's libphonenumber.
Added isPossiblePhoneNumber() and isValidPhoneNumber() functions, which are basically shortucts to parsePhoneNumberFromString(text, { extract: false }) and then .isValid()/.isPossible().
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Fixed the issue with findPhoneNumbersInText() returning incorrect startAt and endsAt positions in some cases.
findPhoneNumbersInText() returning incorrect startAt and endsAt positions in some cases.Refactored the main ES6 export in order to support "tree shaking".
Added AsYouType.getChars() method.
Added AsYouType.getChars() method.
Added formatting of international phone numbers that have been input without a leading +.
Metadata version is now an integer instead of a semver version. Semver versions of previously generated metadata are automatically converted into an i
version is now an integer instead of a semver version. Semver versions of previously generated metadata are automatically converted into an integer version.Merged the latest Google's patch on parsing phone number extensions.
(could be a breaking change for some) Some people might have used some of the _undocumented_ AsYouType instance properties like .countryCallingCode, .…
Refactored AsYouType formatter.
(could be a breaking change for some) Some people might have used some of the undocumented AsYouType instance properties like .countryCallingCode, .nationalNumber, etc: those have been moved to a new .state object. The .state object is also not part of the public API, so developers shouldn't use it: use the documented getter methods instead. The .country property of AsYouType instance still stays: not because it hasn't been moved (it has been and is emulated), but because it has been part of an official (now legacy) API of AsYouType formatter.
(misc) Renamed asYouType instance method getCountryCallingCode() to getCountryCode(). The older name still works.
(could be a build-time breaking change for custom metadata) For those who were generating custom metadata, the libphonenumber-generate-metadata console command has been moved to a separate package called libphonenumber-metadata-generator. The applications that're using it should do npm install libphonenumber-metadata-generator --save-dev and then use the new libphonenumber-metadata-generator command instead of the old one (only the name changed). See instructions.
Nothing published for this version
Refactored AsYouType formatter.
Refactored AsYouType formatter.
Fixed AsYouType formatter not formatting numbers in some cases like, for example, certain types of Argentinian mobile numbers.
<!-- * Found out that all previous metadata was missing domestic_carrier_code_formatting_rule that is used in a few countries (like Argentina) when formatting phone numbers containing "carrier codes". It has been added now. -->
humanReadable option of "IDD" formatting has been removed: now it's always true. The rationale is that Google's formatOutOfCountryCallingNumber() original function always formats in "human readable" format.Nothing published for this version
Nothing published for this version
(advanced) Fixed metadata.mobile.json and generating "custom" metadata: now it won't include non-relevant phone number types. Previously, metadata.mob
metadata.mobile.json and generating "custom" metadata: now it won't include non-relevant phone number types. Previously, metadata.mobile.json (and any other "custom"-generated metadata) included all phone number types for cases when there're several countries corresponding to the same country calling code (for example, US and CA). So, in case of metadata.mobile.json, for DE it only contained mobile phone number type, but for US and CA it contained all phone number types (this has been unnoticed until this release). Now it only contains mobile phone number types for any country, as it's supposed to be. This change didn't result in any significant "mobile" metadata size reduction: just 105 KB -> 95 KB.Nothing published for this version
Renamed parsePhoneNumber() named export to parsePhoneNumberWithError(). The older name still works.
parsePhoneNumber() named export to parsePhoneNumberWithError(). The older name still works.Promoted parsePhoneNumberFromString() named export to a default export due to the name being too verbose.
parsePhoneNumberFromString() named export to a default export due to the name being too verbose.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added some utility functions to AsYouType:
AsYouType:/**
* Returns `true` if the phone number is being input in international format.
* In other words, returns `true` if and only if the parsed phone number starts with a `"+"`.
* @return {boolean}
*/
isInternational()
/**
* Returns the "country calling code" part of the phone number.
* Returns `undefined` if the number is not being input in international format.
* Returns "country calling code" for "non-geographic" phone numbering plans too.
* @return {string} [countryCallingCode]
*/
getCountryCallingCode()
/**
* Returns a two-letter country code of the phone number.
* Returns `undefined` for "non-geographic" phone numbering plans.
* Returns `undefined` if no phone number has been input yet.
* @return {string} [country]
*/
getCountry()
/**
* Returns `true` if the phone number is "possible".
* Is just a shortcut for `PhoneNumber.isPossible()`.
* @return {boolean}
*/
isPossible()
/**
* Returns `true` if the phone number is "valid".
* Is just a shortcut for `PhoneNumber.isValid()`.
* @return {boolean}
*/
isValid()
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Removed the "001" country code ("Non-Geographic Entity"): now in case of "non-geographic" phone numbers their country is just undefined. Instead, Phon
Removed the "001" country code ("Non-Geographic Entity"): now in case of "non-geographic" phone numbers their country is just undefined. Instead, PhoneNumber class has an .isNonGeographic() method.
Fixed "non-geographic" numbers .isPossible() === false bug.
Nothing published for this version
Fixed "Non-Geographic Entities" (001 country code).
001 country code).Nothing published for this version
Nothing published for this version
Refactored the code. Mostly AsYouType formatter. AsYouType.input() no longer accepts "falsy" values like null: instead, it only accepts strings.
Refactored the code. Mostly AsYouType formatter. AsYouType.input() no longer accepts "falsy" values like null: instead, it only accepts strings.
Fixed AsYouType formatter bugs (#318).
Added nationalPrefix: boolean option to PhoneNumber.format() — Some phone numbers can be formatted both with national prefix and without it. In such cases the library defaults to "with national prefix" (for legacy reasons). Pass nationalPrefix: false option to force formatting without national prefix in such cases.
Renamed findNumbers(text, { v2: true }) to findPhoneNumbersInText(text), and searchNumbers(text, { v2: true }) to searchPhoneNumbersInText(text).
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Added getCountries() function that returns a list of all available two-letter country codes. This is to prevent some users from having to deal with Un
getCountries() function that returns a list of all available two-letter country codes. This is to prevent some users from having to deal with Unknown country error.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.