{"name":"escape-goat","version":"4.0.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"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava && tsd"},"keywords":["escape","unescape","html","entity","entities","escaping","sanitize","sanitization","utility","template","attribute","value","interpolate","xss","goat","🐐"],"devDependencies":{"ava":"^3.15.0","tsd":"^0.14.0","xo":"^0.38.2"},"gitHead":"d4a65160f9dfd2ca17b5e1c19811d1f6cb9c786f","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@4.0.0","_nodeVersion":"14.16.1","_npmVersion":"6.14.10","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==","shasum":"9424820331b510b0666b98f7873fe11ac4aa8081","tarball":"http://registry-npm.ywwl.com/escape-goat/download/escape-goat-4.0.0.tgz","fileCount":5,"unpackedSize":6280,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgeR2jCRA9TVsSAnZWagAAWlsP/20l2Mmq0n8afpDnc5hY\nmyz2qse9S6/xCbRjSexyxgcZXmXgKi/zIdjZtxl6JDnvwE8uArLPN+DCAr8/\n1SsqRjNKZA/CuSb+FyaHE+VVmG3CFcVHZQcM2xksk9kp5psZ6pQOZmEAAtBo\ni3el3+CqWCtqn9g1QTNHKfZWQVTL9rctqdtyGih6BemtcLlojNwXM0nxq/rF\namv47zEO1NNGekglIEMLWZQx5hbfnE5Y4zvwdz6iW2eRGINXOjn1vo6w+SR3\nMj9QkHtCO81EVJTf1jF1QQTdYccMQcDl8VDU45Mdqy3Yl3F2lX0akP9JkPXO\nVtPHfIg9UvSBh3sMunhRnmL5kkYlH9kL5NlKzLtln9c1h2Rm2u6WDOo68MMH\nEyKULvr+MAO6swtH8DKfXnJMO8Z009mrDSj3NmXvG3ZQiECPVGhFVfD5aqEf\nBbyQ76gzjvHgRd+2AuzGjULRxp7DaGajiQ/SD4OQdok4jS/LmtGXRGq1c9rY\nwLTfUUfMsOYsi+s/3ttbIiT2M6ZOI0HYZB2pC3KEPjutxMjM61QfwriZExsX\nEHC4JmGV4D4DR3nuJ5ubR53ywNuP/bppQEzcNpKW1WQSGuOlReXPJJ7vzBZ2\nle4T4WjLOsYGtl8Yo62KwMkg02QHqYNQrfsyhGsBloweBZuRAXfEgtK5SJ3e\nZ+fd\r\n=feP7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCWtpxR6Wt3AoonMxbbWfXrjWcdpoOkpnYuXF2L1/97VAIhAKhLcG/UyuHM5QC3w2M3UEoDznIRwYOFgH5h1Y5gy10a"}],"size":2359,"noattachment":false,"key":"/escape-goat/-/escape-goat-4.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_4.0.0_1618550178623_0.7160660400657874"},"_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":1618550178770,"_cnpm_publish_time":1618550178770,"dist-tags":{"latest":"4.0.0"}}