rentzsch / pretty164

Simple E.164 dash-inserter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pretty164: Simple E.164 dash-inserter

Reformats E.164 strings by inserting dashes. No dependancies.

Usage

// node (after `npm install pretty164@1.1.1`):
const { pretty164 } = require("pretty164"); // .cjs
import { pretty164 } from "pretty164"; // or .mjs or package.json type:"module"

// deno:
import { pretty164 } from "https://deno.land/x/pretty164@1.1.1/pretty164.ts";

// web esm:
import { pretty164 } from "https://www.unpkg.com/pretty164@1.1.1/esm/pretty164.js";

pretty164("+14155552671");
//=> "+1-415-555-2671"

pretty164("+442071838750");
//=> "+44-20-7183-8750"

pretty164("nope");
//=> "nope"

References

About

Simple E.164 dash-inserter

License:MIT License


Languages

Language:TypeScript 100.0%