A small collection of useful text transformation commands for VS Code. Select text in
the editor, run a command, and asciioo replaces the selection with the converted result.
Features
This extension currently provides three commands:
ASCII to Hex: Converts selected ASCII text to its hexadecimal representation
Hex to ASCII: Converts selected hexadecimal values to ASCII text
Escaped JSON to JSON: Converts a JSON-encoded string containing escaped JSON into
regular JSON
JSON to Escaped JSON: Converts regular JSON into a JSON-encoded string with escaped
JSON content
How to Use
Select the text you want to convert in your editor
Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P)
Type one of the following commands:
"ASCII to Hex" to convert ASCII text to hexadecimal
"Hex to ASCII" to convert hexadecimal to ASCII text
"Escaped JSON to JSON" to unescape JSON-encoded JSON
"JSON to Escaped JSON" to escape regular JSON as JSON-encoded text
The selected text will be replaced with the converted result. For both JSON
commands, leaving text unselected converts the entire active file.
Examples
ASCII to Hex conversion:
Input: Hello
Output: 48656c6c6f
Hex to ASCII conversion:
Input: 48656c6c6f
Output: Hello
Escaped JSON to JSON conversion:
Input: "{\"name\":\"asciioo\"}"
Output: {"name":"asciioo"}
JSON to Escaped JSON conversion:
Input: {"name":"asciioo"}
Output: "{\"name\":\"asciioo\"}"
Install
VSIX
Download the .vsix file from the latest GitHub release
On VSCode, press Ctrl + Shift + P
Type >Install from VSIX
Navigate to .vsix file location
Select the .vsix file
Git
Clone the project
cd ~/
git clone git@github.com:franciscoamado/asciioo.git
cd asciioo
Installation with npm:
npm run install-ext
Known Issues
Hex to ASCII conversion expects valid hexadecimal input (spaces are automatically removed)
Escaped JSON to JSON conversion expects the selected text to be a JSON string whose
contents are themselves valid JSON
JSON to Escaped JSON conversion expects valid JSON input
Non-printable ASCII characters may not display correctly in the editor