A simple package with CLDR datasets exported as JavaScript objects.
Because you want to include a simple list of time zones, countries, etc. in your application without importing any other unnecessary code.
- Time zones
- Countries
- States / Provinces (US, CA, AU)
npm install just-cldr-datasets --save
import timeZones from 'just-cldr-datasets/timeZones';
import countries from 'just-cldr-datasets/countries';
import states from 'just-cldr-datasets/states';
console.log(timeZones); // ['Africa/Abidjan', 'Africa/Accra', ...]
console.log(countries.CA); // Canada
console.log(states.CA.ON); // Ontario
All datasets includes TypeScript type definitions.
For example, type checker will complain about states.US.AB
as state AB
doesn't exist in US
country.
- Add a generator function to bin/generate.js or manually create a predefined dataset in
predefined
directory. - Run
npm run build
. - Double check the generated JS files.
- Create a PR 🎉