Gathering detailed insights and metrics for locale-util
Gathering detailed insights and metrics for locale-util
npm install locale-util
Typescript
Module System
Min. Node Version
Node Version
NPM Version
80.3
Supply Chain
99.7
Quality
82.2
Maintenance
100
Vulnerability
100
License
TypeScript (64.87%)
JavaScript (35.13%)
Total Downloads
133,176
Last Day
95
Last Week
854
Last Month
5,687
Last Year
88,686
9 Stars
47 Commits
1 Watching
1 Branches
1 Contributors
Minified
Minified + Gzipped
Latest Version
4.5.0
Package Id
locale-util@4.5.0
Unpacked Size
7.81 MB
Size
881.98 kB
File Count
72
NPM Version
10.1.0
Node Version
20.9.0
Publised On
19 Aug 2024
Cumulative downloads
Total Downloads
Last day
-64.9%
95
Compared to previous day
Last week
-45.5%
854
Compared to previous week
Last month
18.3%
5,687
Compared to previous month
Last year
224.9%
88,686
Compared to previous year
2
29
Unicode 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.
1npm install locale-util
The 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.
Here are the methods that you can use to interact with the data:
1import {isCountryCode, findCountry, findCallingCode, findCountryLanguages, 2 isCurrencyCode, findCurrency, isLanguageCode, findLanguage, 3 findCountryTimezones, findTimezoneOffset, findTerritories, findCountryTerritory 4} from 'locale-util' 5 6isCountryCode('TR') // true 7isCountryCode('XX') // false 8 9findCountry('TR') /* 10{ 11 'code': 'TR', 12 'englishName': 'Türkiye', 13 'nativeName': 'Türkiye' 14} 15*/ 16findCountry('ABC') // undefined 17 18findCountryCallingCode('US') // 1 19findCountryCallingCode('TR') // 90 20findCountryCallingCode(null) // undefined 21 22findCountryLanguages('TR') // ['tr'] 23findCountryLanguages('US') // ['en', 'es', 'haw'] 24 25isCurrencyCode('TRY') // true 26 27findCurrency('TRY') /* 28{ 29 'code': 'TRY', 30 'num': 949, 31 'englishName': 'Turkish', 32 'nativeName': 'Türkçe' 33} 34*/ 35 36findCountryCurrencyCode('TR') // TRY 37findCountryCurrencyCode('US') // USD 38 39isLanguageCode('xxx') // false 40isLanguageCode('tr') // true 41 42findLanguage('tr') /* 43{ 44 'code': 'tr', 45 'nativeName': 'Türkçe', 46 'englishName': 'Turkish' 47} 48*/ 49 50findCountryTimezones('TR') /* 51[{ 52 'name': 'Europe/Istanbul', 53 'offset': -180, 54 'country': 'TR' 55}] 56*/ 57 58findCountryTimezones('TT') /* 59[{ 60 'name': 'America/Port_of_Spain', 61 'offset': 240, 62 'country': 'TT' 63}, { 64 'name': 'America/Puerto_Rico', 65 'offset': 240, 66 'country': 'TT' 67}] 68*/ 69 70findTimezoneOffset('America/Puerto_Rico') // 240 71findTimezoneOffset('Europe/Istanbul') // -180 72 73findTerritories() /* 74[ 75 { 76 "code": "005", 77 "name": "South America" 78 }, 79 { 80 "code": "011", 81 "name": "Western Africa" 82 }, 83 ... 84 ... 85] 86*/ 87 88findCountryTerritory('TR') // { code: '145', name: 'Western Asia' } 89findCountryTerritory('TR') // { code: '021', name: 'Northern America' }
Have a look at the tests, types and source for more info.
Data 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.
If you're interested in contributing, read the CONTRIBUTING.md first, please.
Version management of this repository done by releaser 🚀
Thanks for watching 🐬
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-01-27
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More