This is a Google Chrome extension that allows users to convert TypeScript objects from the clipboard to JSON format. It automatically formats the JSON object with indentation for better readability.
- Download or clone the repository
- Open Google Chrome and go to the Extensions page –
chrome://extensions/
- Enable "Developer mode" at the top right corner
- Click on "Load unpacked" and select the directory containing the extension files
- The extension should now be installed and ready to use
Note: The extension requires a recent version of Google Chrome.
🦊 Download the Firefox Version here 🦊
The URLs in the "matches"
field of the "content_scripts"
section in the manifest.json
file must be updated to match the URLs of the webpages where the extension will be used.
Once installed, the extension can be used by copying a TypeScript object to the clipboard and clicking on the extension icon. The TypeScript object will be converted to a formatted JSON string and copied back to the clipboard.
Alternatively, the extension can also be used by pasting a TypeScript object into a text area on a web page that matches the defined "matches" pattern. The extension will automatically format the TypeScript object as a JSON string.
- Copy a TypeScript object to the clipboard
- Click on the extension icon to convert the object to JSON format
- The converted JSON will be copied to the clipboard
- Copy a TypeScript object to the clipboard
- Paste from clipboard into a textarea on a webpage that matches the defined "matches" pattern.
- The converted JSON will be pasted
Note: The extension only works with JavaScript or TypeScript objects, not other types of data.
The extension supports the following keyboard shortcuts for pasting the formatted JSON object:
Cmd+F
(for Mac) orCtrl+F
(for Windows)Cmd+Shift+V
(for Mac) orCtrl+Shift+V
(for Windows)
To paste the formatted JSON object after copying the TypeScript object to the clipboard and pasting into a text area on a webpage that matches the defined "matches" pattern.
Here's an example of what the input TypeScript format looks like:
{
name: "John",
age: 30,
city: "New York"
}
Here's an example of what the output JSON format looks like:
{
"name": "John",
"age": 30,
"city": "New York"
}
This extension has not been tested on all web pages, so it may not work as expected on some sites. If you encounter any issues, please let us know by opening an issue on the GitHub repository.
Contributions are welcome! If you would like to contribute to this project, please fork the repository and submit a pull request. Make sure to follow the existing code style and add any necessary tests.
This project is licensed under the MIT License - see the LICENSE file for details.