{"id":22305710,"url":"https://github.com/muratgozel/locale-util","last_synced_at":"2025-06-18T05:34:44.559Z","repository":{"id":36589545,"uuid":"228601318","full_name":"muratgozel/locale-util","owner":"muratgozel","description":"Unicode CLDR data parser and module, regularly updated based on unicode.org releases.","archived":false,"fork":false,"pushed_at":"2024-08-19T23:02:29.000Z","size":6417,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-05T07:51:12.483Z","etag":null,"topics":["cldr","cldr-json","country-codes","currency-codes","i18n","languages","locale","locale-gen","localization","phone-number","timezones"],"latest_commit_sha":null,"homepage":"https://muratgozel.github.io/locale-util/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muratgozel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"muratgozel","patreon":"muratgozel","open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2019-12-17T11:25:36.000Z","updated_at":"2024-08-19T23:02:31.000Z","dependencies_parsed_at":"2024-03-23T21:36:00.486Z","dependency_job_id":"1d8df8c1-7e28-4e48-af22-f437e153d9c8","html_url":"https://github.com/muratgozel/locale-util","commit_stats":{"total_commits":44,"total_committers":1,"mean_commits":44.0,"dds":0.0,"last_synced_commit":"ff81badb6ce24b03a286a02c2a650fa987df551c"},"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/muratgozel/locale-util","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Flocale-util","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Flocale-util/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Flocale-util/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Flocale-util/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muratgozel","download_url":"https://codeload.github.com/muratgozel/locale-util/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muratgozel%2Flocale-util/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260495574,"owners_count":23017921,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cldr","cldr-json","country-codes","currency-codes","i18n","languages","locale","locale-gen","localization","phone-number","timezones"],"created_at":"2024-12-03T19:12:51.543Z","updated_at":"2025-06-18T05:34:39.536Z","avatar_url":"https://github.com/muratgozel.png","language":"TypeScript","funding_links":["https://github.com/sponsors/muratgozel","https://patreon.com/muratgozel","https://patreon.com/muratgozel?utm_medium=organic\u0026utm_source=github_repo\u0026utm_campaign=github\u0026utm_content=join_link"],"categories":[],"sub_categories":[],"readme":"# locale-util\nUnicode CLDR data parser and module, regularly updated based on https://github.com/unicode-org/cldr releases. Refer to https://muratgozel.github.io/locale-util/ for full api docs.\n\n## Installation\n```sh\nnpm install locale-util\n```\n\n## Usage\nThe package contains large amount of data which is not suitable for browser environment. Benefit from tree-shaking might work if you are interested in small chunks of it.\n\nHere are the methods that you can use to interact with the data:\n```js\nimport {isCountryCode, findCountry, findCallingCode, findCountryLanguages, \n    isCurrencyCode, findCurrency, isLanguageCode, findLanguage, \n    findCountryTimezones, findTimezoneOffset, findTerritories, findCountryTerritory\n} from 'locale-util'\n\nisCountryCode('TR') // true\nisCountryCode('XX') // false\n\nfindCountry('TR') /*\n{\n    'code': 'TR',\n    'englishName': 'Türkiye',\n    'nativeName': 'Türkiye'\n}\n*/\nfindCountry('ABC') // undefined\n\nfindCountryCallingCode('US') // 1\nfindCountryCallingCode('TR') // 90\nfindCountryCallingCode(null) // undefined\n\nfindCountryLanguages('TR') // ['tr']\nfindCountryLanguages('US') // ['en', 'es', 'haw']\n\nisCurrencyCode('TRY') // true\n\nfindCurrency('TRY') /*\n{\n    'code': 'TRY',\n    'num': 949,\n    'englishName': 'Turkish',\n    'nativeName': 'Türkçe'\n}\n*/\n\nfindCountryCurrencyCode('TR') // TRY\nfindCountryCurrencyCode('US') // USD\n\nisLanguageCode('xxx') // false\nisLanguageCode('tr') // true\n\nfindLanguage('tr') /*\n{\n    'code': 'tr',\n    'nativeName': 'Türkçe',\n    'englishName': 'Turkish'\n}\n*/\n\nfindCountryTimezones('TR') /*\n[{\n    'name': 'Europe/Istanbul',\n    'offset': -180,\n    'country': 'TR'\n}]\n*/\n\nfindCountryTimezones('TT') /*\n[{\n    'name': 'America/Port_of_Spain',\n    'offset': 240,\n    'country': 'TT'\n}, {\n    'name': 'America/Puerto_Rico',\n    'offset': 240,\n    'country': 'TT'\n}]\n*/\n\nfindTimezoneOffset('America/Puerto_Rico') // 240\nfindTimezoneOffset('Europe/Istanbul') // -180\n\nfindTerritories() /*\n[\n    {\n        \"code\": \"005\",\n        \"name\": \"South America\"\n    },\n    {\n        \"code\": \"011\",\n        \"name\": \"Western Africa\"\n    },\n    ...\n    ...\n]\n*/\n\nfindCountryTerritory('TR') // { code: '145', name: 'Western Asia' }\nfindCountryTerritory('TR') // { code: '021', name: 'Northern America' }\n```\n\nHave a look at the tests, types and source for more info.\n\n## Keeping Data Up To Date\nData updates published regularly as minor releases so you only need to update the package as new version comes in. If you have a kind of manual setup, download the release you wish from https://github.com/unicode-org/cldr/releases and copy the `common` directory under `cldr-data-common`. Then run `npm run setup`, `compile`, `build` and `test` to parse the new data.\n\n## Contributing\nIf you're interested in contributing, read the [CONTRIBUTING.md](https://github.com/muratgozel/muratgozel/blob/main/CONTRIBUTING.md) first, please.\n\n---\n\nVersion management of this repository done by [releaser](https://github.com/muratgozel/node-releaser) 🚀\n\n---\n\nThanks for watching 🐬\n\n[![Support me on Patreon](https://cdn.muratgozel.com.tr/support-me-on-patreon.v1.png)](https://patreon.com/muratgozel?utm_medium=organic\u0026utm_source=github_repo\u0026utm_campaign=github\u0026utm_content=join_link)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Flocale-util","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuratgozel%2Flocale-util","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuratgozel%2Flocale-util/lists"}