If you use TypeScript regularly, you want to be typesafe. Always. Also with the JSON files that come from your backend.
Did you search “JSON to typescript” before?
I know. I know. You search for it just to copy the JSON and paste the interfaces back to your code. Wouldn’t be awesome to just type
json2ts(your_json) into the console?
With the json2ts plugin, you can convert a JSON object to TypeScipt interfaces directly from the console.
re.json2ts(yourJsonData) and it will print the interfaces and copy the relative code into the clipboard.
The result is automatically copied into the clipboard, ready to be pasted into your IDE.
Often the developer needs to extract the interfaces from a backend response.
You can do this by:
re.json2ts(temp1)into the console
The code of this plugin was adapted from
You can find the plugin at
To use this plugin, you just need redevtools installed (
npm install redevtools +
redevtools.init() in your code ). See the docs for more info about how to install redevtools.