Quick start
Install
Section titled “Install”npm install @telixon/coreParse a number
Section titled “Parse a number”Load the engine once, then parse:
import { ensureEngineReady, parsePhoneNumber } from '@telixon/core';
await ensureEngineReady();
const number = parsePhoneNumber('+14155550132');number.isValid(); // truenumber.getNumberType(); // "MOBILE"number.formatInternational(); // "+1 415-555-0132"Build a phone input
Section titled “Build a phone input”Add @telixon/web-sdk for a DOM-bound input controller:
npm install @telixon/core @telixon/web-sdkimport { ensureEngineReady } from '@telixon/core';import { createPhoneInput } from '@telixon/web-sdk';
await ensureEngineReady();
const phone = createPhoneInput({ input: document.querySelector('#phone'), mode: 'international',});
phone.subscribe((state) => { // state.value, state.region, state.validationError, ...});