dotfile-types
Generates TypeScript interfaces from .env
, .properties
, .ini
, and other key-value
pair files,
including nested types.
Currently uses json-ts, and could technically work with flow.
Usage Example
Check out /test/fixtures/expected for more example outputs.
CLI simple usage: $ dotfile-types <file_path> <out_path>
$ dotfile-types l10n.properties interfaces.d.ts
Tranforms this:
# l10n.properties # What ever happened to the good ol days when it was yesterday universe.attribution.wikimediaLink=<a href="{0}">Photo</a>#{2} - I'm a little comment, short and stout. universe.attribution.wikimediaAlt=Photo "{0}" by {1} ({2}) / Whatchamacalit#{0} Knock knock. Who's there? Comment. Comment Who? # Commentary 🥁... 😭 hats.color=Color for {0}hats.imageAlt=123hats.expensive=日期已停hats.buyMe=See all {0} properties in {1}
Into this:
// interface.d.ts