Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
libphonenumber-geo-carrier
Advanced tools
This library includes the geocoding, carrier mapping and timezone mapping functionalities that are available in some of googles libphonenumber libraries but not in libphonenumber-js (a port of libphonenumber).
This library includes the geocoding, carrier mapping and timezone mapping functionalities that are available in some of googles libphonenumber libraries but not in libphonenumber-js (a port of libphonenumber).
To reduce the amount of data that needs to be loaded to geocode / carrier map a phonenumber for each mapping only the relevant number prefixes are loaded from a binary json file (BSON).
When the prefix could not be found in the provided locale the library tries to fallback to en
as locale.
The library supports Node.js only at the moment.
npm install libphonenumber-js libphonenumber-geo-carrier
or
yarn add libphonenumber-js libphonenumber-geo-carrier
import { parsePhoneNumberFromString } from 'libphonenumber-js'
import { geocoder, carrier, timezone } from 'libphonenumber-geo-carrier'
const main = async () => {
const fixedLineNumber = parsePhoneNumberFromString('+41431234567')
const locationEN = await geocoder(fixedLineNumber) // Zurich
const locationDE = await geocoder(fixedLineNumber, 'de') // Zürich
const locationIT = await geocoder(fixedLineNumber, 'it') // Zurigo
const mobileNumber = parsePhoneNumberFromString('+8619912345678')
const carrierEN = await carrier(mobileNumber) // China Telecom
const carrierZH = await carrier(mobileNumber, 'zh') // 中国电信
const fixedLineNumber2 = parsePhoneNumberFromString('+49301234567')
const tzones = await timezone(fixedLineNumber2) // ['Europe/Berlin']
}
main()
FAQs
This library includes the geocoding, carrier mapping and timezone mapping functionalities that are available in some of googles libphonenumber libraries but not in libphonenumber-js (a port of libphonenumber).
The npm package libphonenumber-geo-carrier receives a total of 4,728 weekly downloads. As such, libphonenumber-geo-carrier popularity was classified as popular.
We found that libphonenumber-geo-carrier demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.