{"_id":"lib-address","_rev":"12-5984712a55ea82b3ac0db512b5a6b890","name":"lib-address","dist-tags":{"latest":"0.7.0"},"versions":{"0.1.0":{"name":"lib-address","version":"0.1.0","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.1.0","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"dcd3524563ae612c46c61802d503b1e0ea51d010","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.1.0.tgz","fileCount":33,"integrity":"sha512-95MtBhiwmK+Ip0qT7SdsC84g0VkTW4xX4nboP+fcHdDc4wshPtKVX3RQ78Hi5wve8pAZ1z3Pq5sjjMxj2w/g+w==","signatures":[{"sig":"MEUCIHiSSpSbAiSIHM0M+bO8y6FOBtAm4nU3hWeYRtrjStVDAiEAw6tiG+bW4Anm+OQjOg/VmhWkr/Wlm8vZipArxen4TpE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":165209},"main":"./dist/entry-node.cjs","type":"module","types":"./dist/entry-node.d.ts","browser":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"gitHead":"f50c7e5b54dd780484f045f9a68396a6365ae429","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.1.0_1699379711538_0.6830325408932947","host":"s3://npm-registry-packages"}},"0.1.1":{"name":"lib-address","version":"0.1.1","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.1.1","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"246e710f8363387961c242313850c8189a3a76fc","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.1.1.tgz","fileCount":285,"integrity":"sha512-zF6lumqVTJT9Msgi7hpeL7LoFXCPaAE+Hx6x1KOAQsJUyYgp8RAyk6RQ3QmIKMEh/bIj80Vc6nZIULWEmxJFuQ==","signatures":[{"sig":"MEYCIQD6K8XciaZBF8j88YZail0upRaNzRcPZkkC7bYDpr0AgQIhAN9xwXnP4rVHKPPPJ85Sctp8xthQWssMQiruJTaXovt8","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2029035},"main":"./dist/entry-node.cjs","type":"module","types":"./dist/entry-node.d.ts","browser":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"gitHead":"dfb0d52316ff949c4d9f94ce8ff7421ce5159954","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.1.1_1699381616518_0.9848789645669593","host":"s3://npm-registry-packages"}},"0.2.0":{"name":"lib-address","version":"0.2.0","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.2.0","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"9a51c7d00e6db8fc084be2a943d0f7773f5af950","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.2.0.tgz","fileCount":285,"integrity":"sha512-6qLE2DZTrcC97WNaOsLK1vZDVOU/XaY+ttqEsUfM+NiDah13u6XShRdNMPLqR+Crokcjmz1K4nMJA6Wont2P0Q==","signatures":[{"sig":"MEUCIQClKUKGMSGcNckWfGRU3khSH19+72IYjr/kY9IN+W9fWgIgVuDI6xfIb3wjFE+unzqF8f+q1cohoMAXznACNTDg5tI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2033542},"main":"./dist/entry-node.cjs","type":"module","types":"./dist/entry-node.d.ts","browser":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"gitHead":"2cc131ae420d134af2c06635466d692a2ae5a6ac","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.2.0_1699382348973_0.7805301933759059","host":"s3://npm-registry-packages"}},"0.3.0":{"name":"lib-address","version":"0.3.0","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.3.0","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"4d964a4cb10ae3b265dddc597f462773c1272646","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.3.0.tgz","fileCount":285,"integrity":"sha512-t0B4NCz21aA1mvnyD4O2w7YqSmgoNE2vmTaG7H5tKp4V7Y1celHQdXvEnXLDZUQIcx714ht3nZVL5mFxTCSS+Q==","signatures":[{"sig":"MEQCID6ldkEryI704BUqDSIvkDk0JzKV6YsG9gDw1TG3ZNOcAiA9AIn8TBdwNJsVBhGln/huLL+ZIwPCH9IZpM6vNho02Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2045323},"main":"./dist/entry-node.cjs","type":"module","types":"./dist/entry-node.d.ts","browser":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"gitHead":"d8ec86b465f12d0da2fc88d21d0de553d469eb59","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.3.0_1699467228051_0.9243360197104069","host":"s3://npm-registry-packages"}},"0.4.0":{"name":"lib-address","version":"0.4.0","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.4.0","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"597e807423ba6141920b783f963698fdc662ec19","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.4.0.tgz","fileCount":285,"integrity":"sha512-ccM6AC4W4W82Py+eGcF0uiGvAuM9cwQrzSEUjVJyVH2HJLPPTU0v3j+x2jUTrox1+YPas3y9tUIY/pOUawcmKg==","signatures":[{"sig":"MEYCIQCyhKEZ9IHZOhF/1MeQ7LCqVWohq8F5bRzDCvjK2PBJfQIhAKRDdeZEfVauTh+x5JEbKXaIkOdZQm049Zbujt+6VSwK","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":2050394},"main":"./dist/entry-node.cjs","type":"module","types":"./dist/entry-node.d.ts","browser":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"gitHead":"fb51bf85541efa6bba101f2b5d05e917c59f92bc","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.4.0_1699469154839_0.2273104862942088","host":"s3://npm-registry-packages"}},"0.5.0":{"name":"lib-address","version":"0.5.0","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.5.0","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"60907042f4751b8ee3aa542b095acac5e8940117","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.5.0.tgz","fileCount":303,"integrity":"sha512-UNhCH+svAOOH0+IWrjQa4tJ3SaGFxvSpoyDf5dM1aq3AnbObae0NY24IIIexDLVa1T2N/7LTQQysAGnGbcoJ5Q==","signatures":[{"sig":"MEUCICCyTkbAPEy1PAdcW98C10G83tYSbJ+dbu96AvTTWov3AiEAvCe5oKEYim68LBZSOBw+NektgVcAvoizonwv5zfrqEc=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1983059},"type":"module","engines":{"node":">=18.18.2"},"exports":{".":{"types":"./dist/entry-browser.d.ts","import":"./dist/entry-node.mjs","browser":"./dist/entry-browser.mjs","require":"./dist/entry-node.cjs"},"./zod":{"types":"./dist/validators/zod.d.ts","import":"./dist/validators/zod.mjs","require":"./dist/validators/zod.cjs"},"./countries/*":"./countries/*"},"gitHead":"f4deec1538f536ac4001c51803f13df2a4a9d01e","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"optionalDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.5.0_1699527343649_0.06610916901830932","host":"s3://npm-registry-packages"}},"0.5.1":{"name":"lib-address","version":"0.5.1","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.5.1","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"35e2cd66de1b10c0fe89d450624820f1d5e5e756","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.5.1.tgz","fileCount":303,"integrity":"sha512-BShC2C3ycHTDQGgWhkq49iiYnoqIZaK2EexZ5B9bj3c8EgXEKXHvNbhXiOGAs3LKBqCnTFqQkcSVxCPFRC3sQg==","signatures":[{"sig":"MEYCIQCFvjimng47j40t/XRPoY9zQdymlPbKCM7aYyW+/a++YQIhALC0Yg5zMbIW2bT9GOL8lxpJisSRxy8m+88dyDB3/hwP","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.5.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1983422},"type":"module","types":"./dist/entry-browser.d.ts","import":"./dist/entry-node.mjs","browser":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"exports":{".":{"types":"./dist/entry-browser.d.ts","import":"./dist/entry-node.mjs","browser":"./dist/entry-browser.mjs","require":"./dist/entry-node.cjs"},"./zod":{"types":"./dist/validators/zod.d.ts","import":"./dist/validators/zod.mjs","require":"./dist/validators/zod.cjs"},"./countries/*":"./countries/*"},"gitHead":"214114c8bd1c435048f4a30a977af9428dc48c75","require":"./dist/entry-node.cjs","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"optionalDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.5.1_1699527715046_0.6962736327273151","host":"s3://npm-registry-packages"}},"0.5.2":{"name":"lib-address","version":"0.5.2","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.5.2","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"bea6538d19ad90eb484c509b8d8d6eebcc319747","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.5.2.tgz","fileCount":303,"integrity":"sha512-dbXU4mwNFdupopAXmIPQlVExDrnJAFqIR90sE5DhhRUbfj1tXu05yaf0bO6Kw3+66wDYxpm3p9y/FCq5FS2SKg==","signatures":[{"sig":"MEQCIA35BPfGAKPAD0Ev10f0BDkREh/VzIpy6zlRvAfSQe6DAiBvLwg18HY0XE9ESTwWtLe9aoWllLaZyNEDtTh0s1p3Cw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.5.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1983384},"main":"./dist/entry-browser.mjs","type":"module","types":"./dist/entry-browser.d.ts","engines":{"node":">=18.18.2"},"exports":{".":{"node":{"import":"./dist/entry-node.mjs","require":"./dist/entry-node.cjs"},"types":"./dist/entry-browser.d.ts","browser":"./dist/entry-browser.mjs"},"./zod":{"node":{"import":"./dist/validators/zod.mjs","require":"./dist/validators/zod.cjs"},"types":"./dist/validators/zod.d.ts"},"./countries/*":"./countries/*"},"gitHead":"c8a458d3a9b3696930989c110ec416ef452a79d8","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"sideEffects":false,"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"optionalDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.5.2_1699547911220_0.15665802968997866","host":"s3://npm-registry-packages"}},"0.5.3":{"name":"lib-address","version":"0.5.3","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.5.3","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"5802f91279aba969976733d59f27058199053f48","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.5.3.tgz","fileCount":303,"integrity":"sha512-8nzPQurHvvz2F7s0WphsjN27IFf8gbppdebzWvl2FnQDZV6FiZUHk2YGLambLVd9+HtbzS1JzmGKAtl+Vq6alQ==","signatures":[{"sig":"MEUCIE5hMxdD3b8zkGebyPHJA92+ePOOiWMYrDWTLgKj+8gAAiEAhH+dE44WHgDgmOnAi+khvDk/ekHdf+hm6qoarZIDWrg=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.5.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1983436},"main":"./dist/entry-browser.mjs","type":"module","types":"./dist/entry-browser.d.ts","module":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"exports":{".":{"node":{"import":"./dist/entry-node.mjs","require":"./dist/entry-node.cjs"},"types":"./dist/entry-browser.d.ts","browser":"./dist/entry-browser.mjs"},"./zod":{"types":"./dist/validators/zod.d.ts","import":"./dist/validators/zod.mjs","require":"./dist/validators/zod.cjs"},"./countries/*":"./countries/*"},"gitHead":"ef6400828fc6f87700a3d34a4c79e0cb31a3f966","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"sideEffects":false,"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"optionalDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.5.3_1699548681323_0.42302417373219825","host":"s3://npm-registry-packages"}},"0.6.0":{"name":"lib-address","version":"0.6.0","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.6.0","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"ef4442f9e365e00d54514e258bf3cabc4b1360fb","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.6.0.tgz","fileCount":303,"integrity":"sha512-fUJJNXO9gI/BcMLezYU4HfFF62BHGhrD88z/Lj3QXtOsPGppB0HTUSYEmyRHrpruqUA1+ontLw4EMEDcUXAmOg==","signatures":[{"sig":"MEYCIQCmkOtCxdixYMC/sT4r/qoKPmKObGYGwR0Ol2G6JfKWDgIhAPXCkhUVn66Tb+dwyYa9dnmGgIHN5yp3g/hqtRR4z9VN","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1984602},"main":"./dist/entry-browser.mjs","type":"module","types":"./dist/entry-browser.d.ts","module":"./dist/entry-browser.mjs","engines":{"node":">=18.18.2"},"exports":{".":{"types":"./dist/entry-browser.d.ts","import":"./dist/entry-node.mjs","browser":"./dist/entry-browser.mjs","require":"./dist/entry-node.cjs"},"./zod":{"types":"./dist/validators/zod.d.ts","import":"./dist/validators/zod.mjs","require":"./dist/validators/zod.cjs"},"./countries/*":"./countries/*","./package.json":"./package.json"},"gitHead":"e67822f7a3a08e7528fa7123e7a0fd37a7a51efd","require":"./dist/entry-browser.mjs","scripts":{"dev":"vite","lint":"eslint --ignore-path .gitignore .","test":"vitest","build":"tsc && vite build && check-export-map","preview":"vite preview","coverage":"vitest run --coverage","scripts:download":"ts-node-esm -P scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.2.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"sideEffects":false,"_nodeVersion":"18.18.2","_hasShrinkwrap":false,"packageManager":"pnpm@8.10.0","devDependencies":{"vite":"^4.5.0","axios":"^1.6.0","eslint":"^8.53.0","vitest":"^0.34.6","ts-node":"^10.9.1","prettier":"^3.0.3","typescript":"^5.2.2","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","vite-plugin-dts":"^3.6.3","check-export-map":"^1.3.0","@types/cli-progress":"^3.11.5","@vitest/coverage-v8":"^0.34.6","immutability-helper":"^3.1.1","eslint-plugin-import":"^2.29.0","eslint-config-prettier":"^9.0.0","rollup-plugin-visualizer":"^5.9.2","@typescript-eslint/parser":"^6.10.0","@typescript-eslint/eslint-plugin":"^6.10.0","@ianvs/prettier-plugin-sort-imports":"^4.1.1"},"optionalDependencies":{"zod":"^3"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.6.0_1699553470806_0.6568319224900092","host":"s3://npm-registry-packages"}},"0.6.3":{"name":"lib-address","version":"0.6.3","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","_id":"lib-address@0.6.3","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"homepage":"https://github.com/LancelotP/lib-address","bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"dist":{"shasum":"1caef92252999ae722e0ef651aa392729480c198","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.6.3.tgz","fileCount":303,"integrity":"sha512-fhXsH+42qHz9+l0fpI4aStzAaRf4WXzAC0SWIwUCrbg7tpCzwfKM9Aj7cuGqNN09daG7sffqk9Gnl5iSAc7dTA==","signatures":[{"sig":"MEQCIF+aHS7fp5uZwSUgB27EZqOm83stM0Eqq2unatjTCyDNAiBj1sDfrxPSof9bGYAGybsSxfYRtxC5hzjQ9hyw/qqsow==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.6.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":1984598},"main":"./dist/entry-browser.mjs","type":"module","types":"./dist/entry-browser.d.ts","module":"./dist/entry-browser.mjs","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/entry-browser.d.ts","import":"./dist/entry-node.mjs","browser":"./dist/entry-browser.mjs","require":"./dist/entry-node.cjs"},"./zod":{"types":"./dist/validators/zod.d.ts","import":"./dist/validators/zod.mjs","require":"./dist/validators/zod.cjs"},"./countries/*":"./countries/*","./package.json":"./package.json"},"gitHead":"b09543b2fb9578c05fd620acf94ab213b35d23e4","require":"./dist/entry-browser.mjs","scripts":{"dev":"vite","lint":"biome check","test":"vitest","build":"tsc && vite build && check-export-map","lint:ci":"biome ci","preview":"vite preview","coverage":"vitest run --coverage","lint:fix":"biome check --write","scripts:download":"pnpm dlx tsx --tsconfig scripts/tsconfig.json scripts/generate-metadata.ts"},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"repository":{"url":"git+https://github.com/LancelotP/lib-address.git","type":"git"},"_npmVersion":"10.9.3","description":"A library to format and validate addresses based on Google's open-source address metadata.","directories":{},"sideEffects":false,"_nodeVersion":"22.20.0","_hasShrinkwrap":false,"packageManager":"pnpm@9.6.0","devDependencies":{"vite":"^7.1.9","axios":"^1.12.2","vitest":"^3.2.4","ts-node":"^10.9.2","typescript":"^5.9.3","@types/node":"^20.8.10","axios-retry":"^3.8.1","cli-progress":"^3.12.0","@biomejs/biome":"2.2.5","vite-plugin-dts":"^4.5.4","check-export-map":"^1.3.1","@types/cli-progress":"^3.11.6","@vitest/coverage-v8":"^3.2.4","immutability-helper":"^3.1.1","rollup-plugin-visualizer":"^6.0.4"},"optionalDependencies":{"zod":"^3.25.76"},"_npmOperationalInternal":{"tmp":"tmp/lib-address_0.6.3_1759981012274_0.6034865290973133","host":"s3://npm-registry-packages-npm-production"}},"0.7.0":{"name":"lib-address","description":"A library to format and validate addresses based on Google's open-source address metadata.","homepage":"https://github.com/LancelotP/lib-address","repository":{"type":"git","url":"git+https://github.com/LancelotP/lib-address.git"},"bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"sideEffects":false,"version":"0.7.0","license":"MIT","type":"module","engines":{"node":">=22.12.0"},"packageManager":"pnpm@9.6.0","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"scripts":{"dev":"vite","build":"tsc && vite build && check-export-map","preview":"vite preview","test":"vitest","lint":"biome check","lint:ci":"biome ci","lint:fix":"biome check --write","coverage":"vitest run --coverage","scripts:download":"pnpm dlx tsx --tsconfig scripts/tsconfig.json scripts/generate-metadata.ts"},"main":"./dist/entry-browser.mjs","module":"./dist/entry-browser.mjs","require":"./dist/entry-browser.mjs","types":"./dist/entry-browser.d.ts","exports":{".":{"types":"./dist/entry-browser.d.ts","browser":"./dist/entry-browser.mjs","import":"./dist/entry-node.mjs","require":"./dist/entry-node.cjs"},"./lite":{"types":"./dist/entry-lite.d.ts","browser":"./dist/entry-lite.mjs","import":"./dist/entry-lite.mjs","require":"./dist/entry-lite.cjs"},"./zod":{"types":"./dist/validators/zod.d.ts","import":"./dist/validators/zod.mjs","require":"./dist/validators/zod.cjs"},"./countries/*":"./countries/*","./package.json":"./package.json"},"devDependencies":{"@biomejs/biome":"2.2.5","@types/cli-progress":"^3.11.6","@types/node":"^20.8.10","@vitest/coverage-v8":"^3.2.4","axios":"^1.12.2","axios-retry":"^3.8.1","check-export-map":"^1.3.1","cli-progress":"^3.12.0","immutability-helper":"^3.1.1","rollup-plugin-visualizer":"^6.0.4","ts-node":"^10.9.2","typescript":"^5.9.3","vite":"^7.1.9","vite-plugin-dts":"^4.5.4","vitest":"^3.2.4"},"optionalDependencies":{"zod":"^3.25.76"},"_id":"lib-address@0.7.0","gitHead":"eecad73b36ceb7090f06b4b9f82aa7dc496b6a22","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-3rZ/KCwCotNA032W+PMfKAqmXNgs+PwTW099z6Uxf4lRRIIcOPTclO3LrSjkxJjIVNSfhITSTmWyW1wY8LM5NQ==","shasum":"e3c69a12e358b48f4c832070bcb8e5d34f928fde","tarball":"https://registry.npmjs.org/lib-address/-/lib-address-0.7.0.tgz","fileCount":309,"unpackedSize":2148132,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/lib-address@0.7.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQD3hPeBSZCHi1yaJUcn7rVMhG2G86x+jVvxXOPRt5YSrgIgJ5bkWCvia+COA6HyBb93h6FPId6DKHBmiyMJqYFSlAQ="}]},"_npmUser":{"name":"lancelotp","email":"lancelot@prigent.dev"},"directories":{},"maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lib-address_0.7.0_1759991924606_0.2317742091911601"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-07T17:55:11.426Z","modified":"2025-10-09T06:38:45.240Z","0.1.0":"2023-11-07T17:55:11.805Z","0.1.1":"2023-11-07T18:26:56.759Z","0.2.0":"2023-11-07T18:39:09.263Z","0.3.0":"2023-11-08T18:13:48.437Z","0.4.0":"2023-11-08T18:45:55.090Z","0.5.0":"2023-11-09T10:55:43.911Z","0.5.1":"2023-11-09T11:01:55.427Z","0.5.2":"2023-11-09T16:38:31.629Z","0.5.3":"2023-11-09T16:51:21.547Z","0.6.0":"2023-11-09T18:11:11.084Z","0.6.3":"2025-10-09T03:36:52.521Z","0.7.0":"2025-10-09T06:38:44.847Z"},"bugs":{"url":"https://github.com/LancelotP/lib-address/issues"},"author":{"name":"Lancelot Prigent","email":"lancelot@prigent.dev"},"license":"MIT","homepage":"https://github.com/LancelotP/lib-address","keywords":["address","metadata","country","formatter","validator","iso","iso 3166-1","iso 3166-2"],"repository":{"type":"git","url":"git+https://github.com/LancelotP/lib-address.git"},"description":"A library to format and validate addresses based on Google's open-source address metadata.","maintainers":[{"name":"lancelotp","email":"lancelot@prigent.dev"}],"readme":"# LibAddress\n\n[![GitHub](https://img.shields.io/github/license/lancelotp/lib-address)](https://github.com/LancelotP/lib-address/blob/main/LICENSE)\n[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/LancelotP/lib-address/release-please.yml)](https://github.com/LancelotP/lib-address/actions)\n[![npm](https://img.shields.io/npm/v/lib-address?link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2Flib-address)](https://www.npmjs.com/package/lib-address)\n[![npm bundle size](https://img.shields.io/bundlephobia/minzip/lib-address?link=https%3A%2F%2Fbundlephobia.com%2Fpackage%2Flib-address)](https://bundlephobia.com/package/lib-address)\n[![codecov](https://codecov.io/gh/LancelotP/lib-address/graph/badge.svg?token=28O9XY6WIH)](https://codecov.io/gh/LancelotP/lib-address)\n\n## Intro\n\nA tiny library for building forms, parsing and formatting addresses based on Google's [AddessValidationMetadata](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata).\n\n### Features\n\n- 🧙‍♂️&nbsp; Full static typesafety & autocompletion.\n- 🌍&nbsp; Supports countries listed in [AddessValidationMetadata](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata).\n- 🪶&nbsp; Tiny - 2.5kb gzipped and zero dependencies.\n- 🛡️&nbsp; [Zod](https://zod.dev) support (optional).\n- 📖&nbsp; Fully documented.\n- 🧪&nbsp; Fully tested.\n- 🎨&nbsp; Supports multiple languages and latinised equivalents.\n- 📦&nbsp; Supports tree-shaking.\n<!-- - 👀&nbsp; Quite a few examples in the [./examples](./examples)-folder -->\n\n## Motivation\n\nWhen building applications for the web, it is often necessary to collect address information from users or companies. However, every country has differents ways of handling addresses.\n\nWhether it is the zip (or postal code) format, the need for a state or province, or the way to format the address itself.\n\nThis library aims to provide a simple API for parsing and formatting addresses and interfaces nicely with [Zod](https://zod.dev).\n\nThe library is written in TypeScript and is fully typed.\n\n## Table of Contents\n\n- [Install](#install)\n- [Usage](#usage)\n- [Lite Version](#lite-version)\n- [API](#api)\n- [Zod](#zod)\n- [Tests](#tests)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Install\n\nUsing npm:\n\n```sh\n$ npm install lib-address\n```\n\nUsing yarn:\n\n```sh\n$ yarn add lib-address\n```\n\nUsing pnpm:\n\n```sh\n$ pnpm add lib-address\n```\n\nUsing bun:\n\n```sh\n$ bun install lib-address\n```\n\nOnce the package is installed, you can import the library using import or require approach:\n\n```ts\nimport { formatAddress, isAddressValid } from \"lib-address\";\n```\n\nWhen the package is used in a browser, you need to include the country data you want to use.\n\n```ts\nimport { registerCountry } from \"lib-address\";\nimport CA from \"lib-address/countries/CA.json\";\nimport US from \"lib-address/countries/US.json\";\n\nregisterCountry(CA);\nregisterCountry(US);\n```\n\nThis is done in order to reduce the size of the package and to allow the user to only include the countries they need. When using it in a Node.js environment, all countries are included by default.\n\n## Usage\n\n```ts\nimport { isAddressValid } from \"lib-address\";\n\nisAddressValid({\n  country: \"FR\",\n  addressLine1: \"1 rue de Rivoli\",\n  city: \"Paris\",\n  zip: \"75001\",\n});\n```\n\n## Lite Version\n\nThe lite version is a lightweight alternative that includes basic country data for all 252+ countries in a single ~50kb bundle (19kb gzip). It's perfect for building address forms without needing to register individual countries.\n\n### When to use Lite\n\n- ✅ Building address forms with dynamic field requirements\n- ✅ Need CSS Grid layouts for address forms\n- ✅ Want all countries available without registration\n- ✅ Bundle size is not critical (adds ~50kb)\n- ❌ Don't need full validation or formatting features\n\n### Import\n\n```ts\nimport {\n  getCountryData,\n  getCountryFields,\n  getGridPattern,\n} from \"lib-address/lite\";\n```\n\n### getCountryData\n\nReturns basic data for a country including format string, zip pattern, required fields, and subdivisions.\n\n```ts\nimport { getCountryData } from \"lib-address/lite\";\n\nconst frData = getCountryData(\"FR\");\nconsole.log(frData);\n\n// {\n//   code: \"FR\",\n//   lfmt: \"%O%n%N%n%A%n%Z %C\",\n//   zip: \"\\\\d{5}\",\n//   require: \"ACZ\",\n//   sub_regions: [...]\n// }\n```\n\n### getCountryFields\n\nReturns field requirements for a country (required, optional, or undefined).\n\n```ts\nimport { getCountryFields } from \"lib-address/lite\";\n\nconst fields = getCountryFields(\"US\");\nconsole.log(fields);\n\n// {\n//   name: \"optional\",\n//   organization: \"optional\",\n//   dependentLocality: undefined,\n//   city: \"required\",\n//   state: \"required\",\n//   zip: \"required\",\n//   sortingCode: undefined,\n//   addressLine1: \"required\"\n// }\n```\n\nUse this to dynamically show/hide form fields or add validation:\n\n```tsx\nimport { getCountryFields } from \"lib-address/lite\";\n\nfunction AddressForm({ country }: { country: string }) {\n  const fields = getCountryFields(country);\n\n  return (\n    <form>\n      <input name=\"addressLine1\" required={fields?.addressLine1 === \"required\"} />\n      {fields?.city && (\n        <input name=\"city\" required={fields.city === \"required\"} />\n      )}\n      {fields?.state && (\n        <input name=\"state\" required={fields.state === \"required\"} />\n      )}\n      {fields?.zip && (\n        <input name=\"zip\" required={fields.zip === \"required\"} />\n      )}\n    </form>\n  );\n}\n```\n\n### getGridPattern\n\nReturns CSS Grid template configuration for laying out address forms according to country-specific formats.\n\n```ts\nimport { getGridPattern } from \"lib-address/lite\";\n\nconst pattern = getGridPattern(\"FR\");\nconsole.log(pattern);\n\n// {\n//   templateColumns: \"repeat(2, 1fr)\",\n//   templateAreas:\n//     '\"organization organization\"\\n' +\n//     '\"name name\"\\n' +\n//     '\"addressLine1 addressLine1\"\\n' +\n//     '\"zip city\"'\n// }\n```\n\nUse this to create country-specific form layouts:\n\n```tsx\nimport { getGridPattern } from \"lib-address/lite\";\n\nfunction AddressForm({ country }: { country: string }) {\n  const pattern = getGridPattern(country);\n\n  return (\n    <div\n      style={{\n        display: \"grid\",\n        gridTemplateColumns: pattern?.templateColumns,\n        gridTemplateAreas: pattern?.templateAreas,\n        gap: \"1rem\",\n      }}\n    >\n      <input style={{ gridArea: \"organization\" }} name=\"organization\" />\n      <input style={{ gridArea: \"name\" }} name=\"name\" />\n      <input style={{ gridArea: \"addressLine1\" }} name=\"addressLine1\" />\n      <input style={{ gridArea: \"city\" }} name=\"city\" />\n      <input style={{ gridArea: \"zip\" }} name=\"zip\" />\n    </div>\n  );\n}\n```\n\n> [!NOTE]\n> The lite version does not include full validation or formatting capabilities. For complete address validation and formatting, use the full API with registered countries.\n\n## API\n\n### Registry\n\n#### registerCountry\n\nUsed in browser environment to register a country. Countries needs to be registered before using the library. This is done in order to reduce the size of the package and to allow the user to only include the countries they need.\n\nOne recommended way to do this is to create a file that will register all the countries you need and import it in your application.\n\n```ts\n// address.ts\nimport { registerCountry } from \"lib-address\";\nimport US from \"lib-address/countries/US.json\";\n\nregisterCount(US);\n\nexport { formatAddress, isAddressValid } from \"lib-address\";\n```\n\n#### getCountryData\n\nReturns data of a registered country. Mostly used internally, prefer the use of helpers to access country data.\n\n```ts\nimport { getCountryData } from \"lib-address\";\n\nconst countryData = getCountryData(\"US\");\n```\n\n#### getRegisteredCountries\n\nReturns a list of registered countries. Useful to build a country select form and only display countries that you have registered.\n\n```tsx\nimport { getRegisteredCountries } from \"lib-address\";\n\nconst countries = getRegisteredCountries();\n\nexport function CountrySelect() {\n  return (\n    <select>\n      {countries.map((country) => (\n        <option key={country.value} value={country.value}>\n          {country.name}\n        </option>\n      ))}\n    </select>\n  );\n}\n```\n\n### Validator\n\n#### isValidCountryCode\n\nChecks if a string is a valid country code (ISO 3166-1 alpha-2)\n\n```ts\nimport { isValidCountryCode } from \"lib-address\";\n\nisValidCountryCode(\"US\"); // true\nisValidCountryCode(\"USA\"); // false\n```\n\n#### isValidSubdivisionCode\n\nChecks if a string is a valid subdivision code (ISO 3166-2)\n\n> [!NOTE\n> The country needs to be registered in order to validate the subdivision code.\n\n```ts\nimport { isValidSubdivisionCode } from \"lib-address\";\n\nisValidSubdivisionCode(\"US\", \"CA\"); // true\nisValidSubdivisionCode(\"US\", \"ZZ\"); // false\n```\n\n#### validateAddress\n\nValidates an address object against country rules.\nThrows a `MissingFieldsError` if any required fields are missing.\nThrows a `InvalidStateError` if the state code is invalid (if applicable).\nThrows a `InvalidZipError` if the zip code is invalid (if applicable).\nThrows a `InvalidZipSubRegionError` if the zip code is invalid for the subdivision (if applicable).\n\n```ts\nimport { validateAddress } from \"lib-address\";\n```\n\n```ts\nvalidateAddress({\n  country: \"US\",\n  addressLine1: \"1 Infinite Loop\",\n  city: \"Cupertino\",\n  subdivision: \"CA\",\n  zip: \"95014\",\n}); // OK\n```\n\n```ts\nvalidateAddress({\n  country: \"US\",\n  addressLine1: \"1 Infinite Loop\",\n  city: \"Cupertino\",\n  subdivision: \"CA\",\n  zip: \"98014\", // <- InvalidZip for US-CA\n}); // InvalidZipSubRegionError\n```\n\n```ts\nvalidateAddress({\n  country: \"US\",\n  addressLine1: \"1 Infinite Loop\",\n  city: \"Cupertino\",\n  subdivision: \"CA\",\n  zip: \"8014\", // <- InvalidZip for US\n}); // InvalidZipError\n```\n\n```ts\nvalidateAddress({\n  country: \"US\",\n  addressLine1: \"1 Infinite Loop\",\n  city: \"Cupertino\",\n  subdivision: \"ZZ\", // <- InvalidState for US\n  zip: \"95014\",\n}); // InvalidStateError\n```\n\n```ts\nvalidateAddress({\n  // Missing Zip and State\n  country: \"US\",\n  addressLine1: \"1 Infinite Loop\",\n  city: \"Cupertino\",\n}); // MissingFieldsError\n```\n\n#### isAddressValid\n\nChecks if an address object is valid against country rules.\nReturns `true` if the address is valid, `false` otherwise.\n\n```ts\nimport { isAddressValid } from \"lib-address\";\n```\n\n```ts\nisAddressValid({\n  country: \"US\",\n  addressLine1: \"1 Infinite Loop\",\n  city: \"Cupertino\",\n  subdivision: \"CA\",\n  zip: \"95014\",\n}); // true\n```\n\n```ts\nisAddressValid({\n  country: \"US\",\n  addressLine1: \"1 Infinite Loop\",\n  city: \"Cupertino\",\n  subdivision: \"CA\",\n  zip: \"98014\", // <- InvalidZip\n}); // false\n```\n\n### Formatter\n\n#### formatAddress\n\nFormats an address object into a string.\n\n```ts\nimport { formatAddress } from \"lib-address\";\n```\n\n```ts\nformatAddress({\n  country: \"AG\",\n  addressLine1: \"123 Main St\",\n});\n\n// 123 Main St\n```\n\n```ts\nformatAddress({\n  country: \"FR\",\n  addressLine1: \"1 rue de Rivoli\",\n  city: \"Paris\",\n  zip: \"75001\",\n});\n\n/**\n * 1 rue de Rivoli\n * 75001 Paris\n */\n```\n\n```ts\nformatAddress({\n  country: \"US\",\n  state: \"CA\",\n  addressLine1: \"1600 Amphitheatre Parkway\",\n  city: \"Mountain View\",\n  zip: \"94043\",\n});\n\n/**\n * 1600 Amphitheatre Parkway\n * MOUNTAIN VIEW, CALIFORNIA 94043\n */\n```\n\nformatAddress can also be used to add recipient information to the address following country specifc formats.\n\n```ts\nformatAddress({\n  country: \"US\",\n  state: \"CA\",\n  addressLine1: \"1600 Amphitheatre Parkway\",\n  city: \"Mountain View\",\n  zip: \"94043\",\n  name: \"John Doe\",\n  organization: \"Acme Corp\",\n});\n\n/**\n * John Doe\n * Acme Corp\n * 1600 Amphitheatre Parkway\n * MOUNTAIN VIEW, CALIFORNIA 94043\n */\n```\n\n```ts\nformatAddress({\n  country: \"FR\",\n  organization: \"Acme Corp\",\n  name: \"John Doe\",\n  addressLine1: \"1 rue de Rivoli\",\n  city: \"Paris\",\n  zip: \"75001\",\n});\n\n/**\n * Acme Corp\n * John Doe\n * 1 rue de Rivoli\n * 75001 PARIS\n */\n```\n\n##### options\n\nformatAddress accepts an optional options object as a second argument.\n\n```ts\ntype FormatAddressOptions = {\n  /**\n   * @description Preserve input case if true\n   * @default false\n   */\n  preserveCase?: boolean;\n  /**\n   * @description Use ISO 3166-2 subdivision code for state if true. Otherwise, use the state name\n   * For example, use \"CA\" instead of \"California\"\n   *\n   * Some countries do not have ISO 3166-2 subdivision codes and will always use the state name regardless of this option\n   * For example, \"HK\" (Hong Kong) and \"KY\" (Cayman Islands)\n   *\n   * @default false\n   */\n  useStateISOCode?: boolean;\n  /**\n   * @description Append country name to the end of the address if true. Useful for international addresses\n   * @default false\n   */\n  appendCountry?: boolean;\n  /**\n   * @description Use ISO 3166-1 alpha-2 country code for country if true. Otherwise, use the country name\n   * @default false\n   */\n  useCountryISOCode?: boolean;\n  /**\n   * @description Lang to use for country and subdivision names. If not provided, the default lang is used. Not all countries support multiple langs\n   */\n  lang?: string;\n  /**\n   * @description Use latinised equivalents for country, subdivision names and format if true. Not all countries support latinised equivalents\n   * @default false\n   */\n  useLatin?: boolean;\n};\n```\n\n### Helpers\n\nHelpers are functions that return data about a country. They are useful to build forms based on country rules.\n\n#### getCountryFields\n\nReturns an object containing all the fields for a country and their rules.\n\n```ts\nimport { getCountryFields } from \"lib-address\";\n\nconst countryFields = getCountryFields(\"US\");\n```\n\n```json\n{\n  \"addressLine1\": \"required\",\n  \"addressLine2\": \"optional\",\n  \"addressLine3\": \"optional\",\n  \"state\": \"required\",\n  \"zip\": \"required\",\n  \"city\": \"required\"\n}\n```\n\n#### getRequiredFields\n\nReturns an array of required fields for a country.\n\n```ts\nimport { getRequiredFields } from \"lib-address\";\n\nconst countryFields = getRequiredFields(\"US\");\n```\n\n```json\n[\"state\", \"zip\", \"city\", \"addressLine1\"]\n```\n\n#### getOptionalFields\n\nReturns an array of optional fields for a country.\n\n```ts\nimport { getOptionalFields } from \"lib-address\";\n\nconst countryFields = getOptionalFields(\"US\");\n```\n\n```json\n[\"state\", \"zip\", \"city\", \"addressLine1\"]\n```\n\n#### getZipExamples\n\nReturns an array of zip code examples for a country.\n\n> [!NOTE]\n> If the country does not have zip code examples, an empty array is returned.\n\n```ts\nimport { getZipExamples } from \"lib-address\";\n\nconst countryFields = getZipExamples(\"US\");\n```\n\n```json\n[\"95014\", \"22162-1010\"]\n```\n\nCan also be used for subdivisions.\n\n```ts\nimport { getZipExamples } from \"lib-address\";\n\nconst countryFields = getZipExamples(\"US\", \"CA\");\n```\n\n```json\n[\"90000\", \"96199\"]\n```\n\n#### getCountryStates\n\nReturns an array of states for a country.\n\n> [!NOTE]\n> If the country does not have states, an empty array is returned.\n\n```ts\nimport { getCountryStates } from \"lib-address\";\n\nconst countryFields = getCountryStates(\"US\");\n```\n\n```json\n[\n  {\n    \"code\": \"AL\",\n    \"name\": \"Alabama\"\n  },\n  {\n    \"code\": \"AK\",\n    \"name\": \"Alaska\"\n  },\n  ...\n]\n```\n\n## Zod\n\nThis library exports a [Zod](https://zod.dev/) schema for validating addresses.\n\n> [!NOTE]\n> The Zod schema is not exported by default in order to reduce the size of the package. If you want to use it, you need to import it from `lib-address/zod`.\n> Zod is not a dependency of this library and needs to be installed separately.\n\n```ts\nimport { getAddressSchema } from \"lib-address/zod\";\n```\n\n```ts\nimport { z } from \"zod\";\n\nconst formSchema = z.object({\n  name: z.string().min(1),\n  address: getAddressSchema(),\n});\n\nfunction validateForm(data: unknown) {\n  return formSchema.parse(data);\n}\n```\n\n> [!WARNING]\n> The Zod schema will throw if you attempt to validate a country that is not registered. (Only applicable in browser environment)\n\n## Tests\n\nTo run tests:\n\n```\npnpm test\n```\n\nTo generate a code coverage report:\n\n```\npnpm coverage\n```\n\nThe code coverage report can be viewed by opening `./coverage/index.html`.\n\n## Contributing\n\nPull requests are welcome. For major changes, please open an issue first\nto discuss what you would like to change.\n\nPlease make sure to update tests as appropriate.\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n","readmeFilename":"README.md"}