happyphone
TypeScript icon, indicating that this package has built-in type declarations

1.0.17 • Public • Published

happyphone

Make your phone number nice and easy to remember

specification

  • Choose the language in which to translate the phone number.
  • Divide the number into groups of 3 (Including the international prefix, without +).
  • For each group of numbers a word is chosen from the dictionary.
  • The character '+' is ignored.
  • If the group of numbers starts with zero then you ignore it.

examples

+ABCDEFGH is divided into groups of numbers for the dictionary (in the available dictionaries):

ABC = dictionary line

DEF = dictionary line

GH = dictionary line

installation

npm install happyphone

run example (examples directory)

npm start

lint code

npm run tslint

usage

// Typescript
import { HappyPhone } from "happyphone";
var t = new HappyPhone.Converter();
t.happyphone("328274", "ITALIAN", (TAI) => {
    console.log(TAI);
});
// ['cedrata', 'buio']
 
t.happyphone(['cedrata', 'buio'], "ITALIAN", (TAI) => {
    console.log(TAI);
});
// ['328', '274']
// Javascript
var _hp = require("happyphone")
var t = new _hp.HappyPhone.Converter();
 
t.happyphone("328274", "ITALIAN", (TAI) => {
    console.log(TAI);
});
// ['cedrata', 'buio']
 
t.happyphone(['cedrata', 'buio'], "ITALIAN", (TAI) => {
    console.log(TAI);
});
// ['328', '274']

Package Sidebar

Install

npm i happyphone

Weekly Downloads

6

Version

1.0.17

License

Creative Commons Attribution-ShareAlike 4.0 International License

Unpacked Size

4.53 MB

Total Files

223

Last publish

Collaborators

  • tailot