{"name":"escape-goat","version":"2.1.1","description":"Escape a string for use in HTML or the inverse","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/escape-goat.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["escape","unescape","html","entity","entities","escaping","sanitize","sanitization","utility","template","attribute","value","interpolate","xss","goat","🐐"],"devDependencies":{"ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"4d0dac2f019c9de3100615e2ba4ebace042bd604","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@2.1.1","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==","shasum":"1b2dc77003676c457ec760b2dc68edb648188675","tarball":"http://registry-npm.ywwl.com/escape-goat/download/escape-goat-2.1.1.tgz","fileCount":5,"unpackedSize":6276,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiJLbCRA9TVsSAnZWagAA5EcP+QBQe1v7XzBGNk2FjFbp\nQjeLTMO1TlLvll7utlS680w+jrv8lMJ7UeAZRiu6V/9k/Okdve0DANQQNQpI\nJCVaM79PMk3su9tVKw2itxCdK57wXcugxvFhcLzutLD4OngFqrokSq4EGCdO\nMFNBFR1HrtA6wAnGWIgjK4Ob1Iw6Ei1OzfB2pgE6DlqbTj8IeVtX1wPp3dK2\n2TH7QTWlSLngBxAph31b/3enl+shuNS3B3vp4O8HxLo1WBOzYUfoM+Iqi1jG\nKTLyhWI+4VkajucU/TAfijgWP6FvCwA/7evVvT6mPoaMl0x7VSOydsNjgsZR\nnYTyH4VHMHDkChLzyi2/a1rco8IpJhBR+P4MfW2qIwPQnXMM/VkISv7A+r4T\noOPj+TQd+s4jfr5txg98vdtMB4sFgyx/5MmS73mzLVjzCokEiNg/RMAqH0uD\nKG+2SE/7Cb9AsD+QQcL5nXoPYok5Foa1Pq0Z1kW1/WxXskGiZWV2uvuX1tH5\nMB+kdFMEXah78th+bi2q1dIluVeuzetKsy9z5h59th29CyaxMKgsWqSuW7Js\nWx/QlqH0v6P43b6MS+xKIVkmOgAH9luqnzMREyhA6woikEXh5HZMKGIIql7W\ntuFB7eb8E6z+qZPdAXEV7zidZd+ULt5DYKcx+5m+CLJe+GqZUejg1htmImkI\n04Mj\r\n=825e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCljPR4a5Kvf5vqUnPWmN2d0dd4d0XrwdjrJORG0b7A0AIhAMC8KtbJdWYhZ/lndkQlY9wEdReODJGbPDrvsIM0imIk"}],"size":2392,"noattachment":false,"key":"/escape-goat/-/escape-goat-2.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_2.1.1_1569231578518_0.37111587499704446"},"_hasShrinkwrap":false,"readme":"<h1>\n\t<img src=\"logo.jpg\" width=\"1280\" alt=\"escape-goat\">\n</h1>\n\n> Escape a string for use in HTML or the inverse\n\n## Install\n\n```\n$ npm install escape-goat\n```\n\n## Usage\n\n```js\nimport {htmlEscape, htmlUnescape} from 'escape-goat';\n\nhtmlEscape('🦄 & 🐐');\n//=> '🦄 &amp; 🐐'\n\nhtmlUnescape('🦄 &amp; 🐐');\n//=> '🦄 & 🐐'\n\nhtmlEscape('Hello <em>World</em>');\n//=> 'Hello &lt;em&gt;World&lt;/em&gt;'\n\nconst url = 'https://sindresorhus.com?x=\"🦄\"';\n\nhtmlEscape`<a href=\"${url}\">Unicorn</a>`;\n//=> '<a href=\"https://sindresorhus.com?x=&quot;🦄&quot;\">Unicorn</a>'\n\nconst escapedUrl = 'https://sindresorhus.com?x=&quot;🦄&quot;';\n\nhtmlUnescape`URL from HTML: ${escapedUrl}`;\n//=> 'URL from HTML: https://sindresorhus.com?x=\"🦄\"'\n```\n\n## API\n\n### htmlEscape(string)\n\nEscapes the following characters in the given `string` argument: `&` `<` `>` `\"` `'`\n\nThe function also works as a [tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that escapes interpolated values.\n\n### htmlUnescape(htmlString)\n\nUnescapes the following HTML entities in the given `htmlString` argument: `&amp;` `&lt;` `&gt;` `&quot;` `&#39;`\n\nThe function also works as a [tagged template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals) that unescapes interpolated values.\n\n## Tip\n\nEnsure you always quote your HTML attributes to prevent possible [XSS](https://en.wikipedia.org/wiki/Cross-site_scripting).\n\n## FAQ\n\n### Why yet another HTML escaping package?\n\nI couldn't find one I liked that was tiny, well-tested, and had both escape and unescape methods.\n","publish_time":1569231578647,"_cnpm_publish_time":1569231578647,"dist-tags":{"latest":"4.0.0"}}