Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aduh95/format-phone-number

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aduh95/format-phone-number

Simple JavaScript library that takes a phone number in the E164 format and returns it in an international format. It's using Google's [libphonenumber](https://github.com/google/libphonenumber) as a source of truth for how to format a phone number.

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

@aduh95/format-phone-number

Simple JavaScript library that takes a phone number in the E164 format and returns it in an international format. It's using Google's libphonenumber as a source of truth for how to format a phone number.

Usage

npm install @aduh95/format-phone-number

# or if you're using yarn
yarn add @aduh95/format-phone-number
import format from "@aduh95/format-phone-number";

await format("+16135991209"); // +1 613-599-1209

// You can omit the leading `+`
await format("16135991209"); // +1 613-599-1209

Ensure that the phone number is valid and includes the country code, otherwise you'll get undefined behavior.

Build

yarn install
yarn build
yarn test

Keywords

FAQs

Package last updated on 28 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc