JSON Utility is VSCode extension which is helps to
- Convert TypeScript Interface to JSON Sample
- JSON to TypeScript Interface
- Fix the JSON Object
- Beautify the JSON String (Prettify & Minify)
- Install via VSCode Extensions
- Open VSCode Extensions panel using
Cmd+Shift+X
shortcut. - Type
JSON Utility
in Search bar. - Select the
JSON Utility
and install the extension.
- Open VSCode Extensions panel using
- Select the TypeScript Interface from the file (If you didn't select it then JSON Utility takes the full content in the file as input)
- Run the extension using any one of the option in below.
- Use the Command Palette (
Cmd+Shift+P
) -> TypeJSON Utility
-> SelectJSON Utility: Convert Interface to JSON Sample
- Use the shortcut
Ctrl + Alt + J
- Use the Command Palette (
- Select the JSON from the file (If you didn't select it then JSON Utility takes the full content in the file as input)
- Run the extension using any one of the option in below.
- Use the Command Palette (
Cmd+Shift+P
) -> TypeJSON Utility
-> SelectJSON Utility: Convert JSON to Interface
- Use the shortcut
Ctrl + Alt + T
- Use the Command Palette (
- Select the JSON from the file (If you didn't select it then JSON Utility takes the full content in the file as input)
- Run the extension using any one of the option in below.
- Use the Command Palette (
Cmd+Shift+P
) -> TypeJSON Utility
-> SelectJSON Utility: Fix the JSON
- Use the shortcut
Ctrl + Alt + F
- Use the Command Palette (
1. Prettify the JSON
- Select the JSON from the file (If you didn't select it then JSON Utility takes the full content in the file as input)
- Run the extension using any one of the option in below.
- Use the Command Palette (
Cmd+Shift+P
) -> TypeJSON Utility
-> SelectJSON Utility: Prettify the JSON
. - Use the shortcut
Ctrl + Alt + P
- Use the Command Palette (
2. Minify the JSON
- Select the JSON from the file (If you didn't select it then JSON Utility takes the full content in the file as input)
- Run the extension using any one of the option in below.
- Use the Command Palette (
Cmd+Shift+P
) -> TypeJSON Utility
-> SelectJSON Utility: Minify the JSON
- Use the shortcut
Ctrl + Alt + M
- Use the Command Palette (
JSON Utility has few configurations. If you want to change the default configuration, select the required option.
Name | Setting | Default | Description |
---|---|---|---|
Output | json-utility.output | New Window | Either open the result in new window or same input file |
Type In UnionTypes | json-utility.typeInUnionTypes | Random Type | Which type needs to select in the union types for JSON output? Example: interface Test { name : (string | number | boolean) } Here the name property can have string or number or boolean type. In the JSON output, the value of name property should be belongs to which type. The type will be picked randomly from these three types. You can change to First Type(Here string ) as default for JSON output. |
See the release notes for the full set of changes.
See the license details.
Feel free to submit a pull request if you find any bugs (To see a list of active issues, visit the Issues section). Please make sure all commits are properly documented.
Icons Credit : document icons PNG Designed By IYIKON from pngtree