About the string escaper
Escaping is how you put a string inside another format without the string being read as part of that format. Every format has its own rules, they look similar, and they are not interchangeable — which is why one tool with a target selector is more useful than remembering nine sets of conventions.
The JSON and JavaScript targets are almost the same, and the difference matters. U+2028 and U+2029 are perfectly legal inside a JSON string but are line terminators in older JavaScript, so JSON pasted directly into a script can fail to parse for reasons invisible on screen. The JavaScript target escapes them; the JSON target leaves them alone, because JSON parsers handle them correctly.
HTML has two targets for the same reason. Escaping text between tags only requires &, < and >. Escaping a value that will sit inside an attribute also requires the quote characters, because a value containing a quote can close the attribute early and add attributes of its own. Using the text rules for an attribute is a well-worn way to introduce an injection.
The CSV target only quotes a field when the field needs it — when it contains a comma, a quote or a newline. Quoting everything is valid CSV and makes a diff of the file unreadable. The shell target wraps in single quotes, which disables every expansion the shell would otherwise perform, and handles the awkward case of a literal single quote inside.
One thing to be clear about: the SQL target doubles quote characters, which is the correct way to write a literal, and it is not protection against injection. Parameterised queries are. If you find yourself escaping a value in order to concatenate it into a query, the escaping is not the part that needs fixing.