Generate a JSON file containing time zones from the official IANA Database or your own zone.tab file 🚀
https://ayco.io/n/generate-timezone-json
| .gitignore | ||
| index.js | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
Generate Timezone JSON
Installation
Run npm i generate-timezone-json to install in your current node project
or install globally with npm i -g generate-timezone-json
Usage
- Run:
npx generate-timezone-jsonto generate timezones.json from official IANA Database,- this will generate a file named "timezones.json" with data coming from the official IANA database
- Run:
npx generate-timezone-json <filename>to generate timezones.json from a TAB file,- for example, using a file named "zone.tab":
generate-timezone-json zone.tab
- for example, using a file named "zone.tab":
If installed globally, the npx is optional.
Important Note: the structure of the generated JSON file will be different depending on the source (i.e, zone.tab or the IANA timezones database)
Planned features (not yet implemented)
- Specify an output directory with option
--outDir:generate-timezone <filename> --outDir <directory> - Uniform JSON structure for all sources
- type definitions