UNPKG

zipcodes-us

Version:

Fast, lightweight US ZIP code lookup library providing city, state, county, and geographic coordinates with TypeScript support - works in both browser and Node.js

19 lines (18 loc) 703 B
import { ZipCodeInfo, RawZipData } from "./types.js"; /** * Parses a line from the GeoNames US.txt file * @param line A tab-separated line from the data file * @returns Parsed ZIP code data object */ export declare function parseLine(line: string): RawZipData | null; /** * Converts raw data to the public ZipCodeInfo format * @param rawData Raw data from the parsed file * @returns Clean ZipCodeInfo object for public use */ export declare function toZipCodeInfo(rawData: RawZipData): ZipCodeInfo; /** * Loads ZIP code data - works in both browser and Node environments * @returns Map of ZIP codes to their information */ export declare function loadZipCodeData(): Map<string, ZipCodeInfo>;