UNPKG

@phonecheck/phone-number-validator-js

Version:

Validate, parse, and enrich international phone numbers — geocoding, carrier lookup, and timezone resolution. Sync (Node) + async (serverless) APIs, platform adapters, and a CLI.

18 lines (17 loc) 1.33 kB
/** * Public Node.js entry point. * * Wires the bundled `resources/` directory into the core resolver via a * synchronous `node:fs` loader, then re-exports the full public surface. * * For serverless / edge runtimes (no `node:fs`), import from * `@phonecheck/phone-number-validator-js/serverless` and supply your own * `ResourceLoader` (KV / R2 / S3 / fetch) via `setResourceLoader()`. */ export * from 'libphonenumber-js'; export { clearCache, DEFAULT_CACHE_SIZE, getCacheSize, getCacheStats, setCacheSize } from './cache'; export { carrier, carrierAsync, type EnrichmentResult, type EnrichOptions, enrichPhoneNumber, geocoder, geocoderAsync, getResourceLoader, setResourceLoader, timezones, timezonesAsync, } from './core'; export { NodeFsResourceLoader, type NodeFsResourceLoaderOptions } from './node-fs-loader'; export { executeValidation, type PhoneValidationResult, validateBatch, validateSingle, } from './serverless/_shared/dispatch'; export { type BatchOptions, type BatchValidation, classifyRequest, extractBatchOptions, MAX_BATCH_SIZE, type ValidationDispatch, type ValidationFailure, type ValidationRequestBody, validateBatchField, } from './serverless/_shared/validation'; export type { CacheStats, CarrierLocale, GeocoderLocale, LookupTable, MaybePhoneNumber, ResourceKind, ResourceLoader, } from './types';