{"name":"escape-goat","version":"1.3.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":"deaa41d2e6a2b6345ec23fa9e5b8ff1706693c9b","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@1.3.0","_npmVersion":"5.3.0","_nodeVersion":"8.2.1","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-E2nU1Y39N5UgfLU8qwMlK0vZrZprIwWLeVmDYN8wd/e37hMtGzu2w1DBiREts0XHfgyZEQlj/hYr0H0izF0HDQ==","shasum":"bf3ee8ad1e488fbba404b084b2e4a55e09231c64","tarball":"http://registry-npm.ywwl.com/escape-goat/download/escape-goat-1.3.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDQoPTygQpC+lecK+5OEl6AywcDB5pJlfL005n8fgT3eAIgd66fbZS99VRmlyGVkFwXvXo15prTUcrl8JgC6qs9xhw="}],"size":2118,"noattachment":false,"key":"/escape-goat/-/escape-goat-1.3.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat-1.3.0.tgz_1501497698607_0.654048390686512"},"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":1501497699478,"_cnpm_publish_time":1501497699478,"dist-tags":{"latest":"4.0.0"}}