Convert your .json to .d.ts
This is simply a CLI wrapper for the json2ts library, which also handles edge cases such as whitespaces or invalid JS characters in keys.
- Node.js
- npm
You can install it from npm using your preferred package manager, e.g.
npm i -g json2ts-cli
To generate .d.ts types from your JSON file, run the following command. It will generate the type definitions in the same directory as the JSON files:
json2ts ./example.json
Just me - this is a really small project ;)
Btw, I couldn't have made this without the json2ts library, so please consider giving it a star!