
Product
A Fresh Look for the Socket Dashboard
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
libphonenumber-node
Advanced tools
npm install libphonenumber-node
var libphonenumber = require('libphonenumber-node');
// Human readable to E164. All of these will print +12125555555.
// The country code is necessary if our input has local numbers.
console.log(libphonenumber.format('212 555-5555', 'US'));
console.log(libphonenumber.format('(212) 555-5555', 'US'));
console.log(libphonenumber.format('212-555-5555', 'US'));
console.log(libphonenumber.format('+1 212-555-5555', 'US'));
// E164 to human readable.
console.log(libphonenumber.format('+12125555555', 'global')); // +1 212-555-5555
console.log(libphonenumber.format('+12125555555', 'local')); // (212) 555-5555
console.log(libphonenumber.format('+12125555555', 'url')); // tel:+1-212-555-5555
console.log(libphonenumber.format('+12125555555', 'e164')); // +12125555555
// Utility functions
console.log(libphonenumber.isValid('+12125555555')); // true
console.log(libphonenumber.isValid('foo')); // false
console.log(libphonenumber.getCountryCode('+12125555555')); // US
console.log(libphonenumber.getType('+12125555555')); // FIXED_LINE_OR_MOBILE
Typing make
should sync the code with the latest official libphonenumber.
FAQs
libphonenumber for node.js
The npm package libphonenumber-node receives a total of 20 weekly downloads. As such, libphonenumber-node popularity was classified as not popular.
We found that libphonenumber-node demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
We’ve redesigned the Socket dashboard with simpler navigation, less visual clutter, and a cleaner UI that highlights what really matters.
Industry Insights
Terry O’Daniel, Head of Security at Amplitude, shares insights on building high-impact security teams, aligning with engineering, and why AI gives defenders a fighting chance.
Security News
MCP spec updated with structured tool output, stronger OAuth 2.1 security, resource indicators, and protocol cleanups for safer, more reliable AI workflows.