{"name":"escape-goat","version":"1.2.0","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":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["escape","unescape","html","entity","entities","escaping","sanitize","sanitization","utility","template","attribute","value","interpolate","xss","goat","🐐"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"38f9c58ba489eab97d7515f6c4973b34a59fd7f1","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@1.2.0","_npmVersion":"5.0.0","_nodeVersion":"8.0.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-toMo+EtOEAy3BJV9FOadCu0j9UcesqhAD8sylGpJNPg1K04EzLADXJJ5UqwHKn6ave3uySzEQaCWYdME08QTYg==","shasum":"cea2d733ede4d9c2fd6b5fe83c83677de6d1807e","tarball":"http://registry-npm.ywwl.com/escape-goat/download/escape-goat-1.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAPKjhopB9vAg0MeIn1FRx5cy180ZO5ZimA1NTzrOjUcAiBAVADs2a5K2TBp5d+83f46SLG2QhbE1EleqC0JoUxeow=="}],"size":2136,"noattachment":false,"key":"/escape-goat/-/escape-goat-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat-1.2.0.tgz_1500673728312_0.22979621612466872"},"directories":{},"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":1500673729258,"_cnpm_publish_time":1500673729258,"dist-tags":{"latest":"4.0.0"}}