{"repo":"sindresorhus/escape-goat","free":true,"listed":false,"github":"https://github.com/sindresorhus/escape-goat","clone":"git clone https://github.com/sindresorhus/escape-goat.git","description":"&🐐; Escape a string for use in HTML or the inverse","language":"JavaScript","stars":551,"topics":["goats","goat","caprine","escape","html","javascript","nodejs"],"license":"MIT","category":"security-tools","readme_excerpt":"Escape a string for use in HTML or the inverse Install Usage API htmlEscape(string) Escapes the following characters in the given string argument: & \" ' The function also works as a tagged template literal that escapes interpolated values. Note: This method of escaping is only safe when inserting data into normal tags like body , div , p , b , td , etc. Inserting htmlEscape 'd data into tags like script and style opens your app to XSS vulnerabilities . htmlUnescape(htmlString) Unescapes the following HTML entities in the given htmlString argument: &amp; &lt; &gt; &quot; &#39; The function also works as a tagged template literal that unescapes interpolated values. Tip Ensure you always quote your HTML attributes to prevent possible XSS. FAQ Why yet another HTML escaping package? I couldn't find one I liked that was tiny, well-tested, and had both escape and unescape methods.","default_branch":null,"files":null,"tree":[],"storefront":"/r/sindresorhus","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sindresorhus/escape-goat/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}