sunjw / jstoolnpp

A JavaScript (JSON) tool for Notepad++ (formerly JSMinNpp) and Visual Studio Code.
GNU General Public License v2.0
284 stars 24 forks source link

Add an option in the Notepad++ menu to escape and unescape a JSON string #142

Open javierlarota opened 1 year ago

javierlarota commented 1 year ago

It would be great if the plugin has an option to escape and unescape a JSON in the same window or in a new window

Something like:

From {"name":"John","age":30,"car":null}

Into {\"name\":\"John\",\"age\":30,\"car\":null}

or From

{
  "name": "John",
  "age": 30,
  "car": null
}

Into {\r\n \"name\": \"John\",\r\n \"age\": 30,\r\n \"car\": null\r\n}

Or the other way around, from an escaped string to an unescaped JSON

From {\"name\":\"John\",\"age\":30,\"car\":null} Into {"name":"John","age":30,"car":null}

Similar to this: https://www.freeformatter.com/json-escape.html#before-output

sunjw commented 1 year ago

I'll leave this open to see if any others want it.