mathiasbynens/jsesc: Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data.
13-Dec-2024 20
Given some data, jsesc returns a stringified representation of that data. jsesc is similar to JSON.stringify() except:
it outputs JavaScript instead of JSON by default, enabling support for data structures like ES6 maps and sets;
it offers many options to customize the output;
its output is ASCII-safe by default, thanks to its use of escape sequences where needed.
For any input, jsesc generates the shortest possible valid printable-ASCII-only output. Here’s an online demo.
mathiasbynens/jsesc: Given some data, jsesc returns the shortest possible stringified & ASCII-safe representation of that data. #js #javascript #mathiasbynens/jsesc: #Given #data, #jsesc #returns #shortest #possible #stringified #ASCII-safe #representation #data. https://javascript.ba/link/mathiasbynens-jsesc-given-some-data-jsesc-returns-the-shortest-possible-stringified-ascii-safe-representation-of-that-data