{"library":"node-phonenumber","title":"Google's libPhoneNumber for Node.js (Legacy)","description":"node-phonenumber is a JavaScript port of Google's `libphonenumber` library, designed to parse, format, and validate international phone numbers within Node.js environments. The package is currently at version 1.0.0, with its last update occurring approximately 8 years ago (as of 2024). Due to its age, it is considered abandoned and no longer actively maintained. This means it likely contains outdated phone number metadata, which is critical for accurate validation and formatting of global telephone numbers, as these can change frequently. Modern alternatives like `libphonenumber-js` or `awesome-phonenumber` are actively maintained, include up-to-date data, offer ES module support, and provide TypeScript definitions, making them significantly better choices for new projects. This package primarily relies on CommonJS for module imports and does not offer native TypeScript support.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install node-phonenumber"],"cli":null},"imports":["const phone = require('node-phonenumber');","const phoneUtil = phone.PhoneNumberUtil.getInstance();","const PNF = phone.PhoneNumberFormat;"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const phone = require('node-phonenumber');\n\nconst phoneUtil = phone.PhoneNumberUtil.getInstance();\n\n// Parse a phone number with country code 'MY' (Malaysia)\nconst phoneNumber = phoneUtil.parse('0139348815', 'MY');\n\n// Format the phone number to INTERNATIONAL format\nconst toNumber = phoneUtil.format(phoneNumber, phone.PhoneNumberFormat.INTERNATIONAL);\n\nconsole.log(toNumber); // Expected output: +60 13-934 8815\n\n// Example: check if the number is valid for the region\nconst isValid = phoneUtil.isValidNumberForRegion(phoneNumber, 'MY');\nconsole.log(`Is valid for MY: ${isValid}`);\n\n// Example: get country code\nconsole.log(`Country code: ${phoneNumber.getCountryCode()}`);","lang":"javascript","description":"Demonstrates parsing a phone number with a region code, formatting it to international standard, checking its validity, and extracting the country code.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}