Tuesday, November 01, 2022

phone numbers validation libs

 libphonenumber-js - npm

Google's libphonenumber is an ultimate phone number formatting and parsing library developed by Google for Android phones. It is written in C++ and Java, and, while it has an official autogenerated javascript port, that port is tightly coupled to Google's closure javascript framework, and, when compiled into a bundle, weighs about 550 kB (350 kB code + 200 kB metadata).

With many websites today asking for user's phone number, the internet could benefit from a simpler and smaller library that would just get the parsing and formatting right, and that's what libphonenumber-js is.

  • Smaller footprint: 145 kB (65 kB code + 80 kB sufficient metadata) vs the original Google's 550 kB (350 kB code + 200 kB full metadata).

npm size does not seem to be relevant for deployment

Unpacked Size

7.56 MB

Weekly Downloads

3,022,778


google-libphonenumber - npm

The up-to-date and reliable Google's libphonenumber package for node.js. Zero dependencies.

Unpacked Size

603 kB

Weekly Downloads

1,067,801