{"name":"escape-goat","version":"3.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":"sindresorhus.com"},"engines":{"node":">=10"},"scripts":{"test":"xo && ava && tsd"},"keywords":["escape","unescape","html","entity","entities","escaping","sanitize","sanitization","utility","template","attribute","value","interpolate","xss","goat","🐐"],"devDependencies":{"ava":"^2.4.0","tsd":"^0.11.0","xo":"^0.25.3"},"gitHead":"02a4b7973b36ee18bb10789a631841904dcdcd7a","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@3.0.0","_nodeVersion":"10.17.0","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-w3PwNZJwRxlp47QGzhuEBldEqVHHhh8/tIPcl6ecf2Bou99cdAt0knihBV0Ecc7CGxYduXVBDheH1K2oADRlvw==","shasum":"e8b5fb658553fe8a3c4959c316c6ebb8c842b19c","tarball":"http://registry-npm.ywwl.com/escape-goat/download/escape-goat-3.0.0.tgz","fileCount":5,"unpackedSize":6358,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHof1CRA9TVsSAnZWagAA5EkP/RJfKnseNeeDoHasUZDJ\nW/i1T9uvI0/ypc/JNPCMTySoB3WN8Z63kM1wUF0f0fmVP3cGNghSnEItjjLN\naxppivg97pLzAPQKYE9wXhbFFWvzTeEK6VJFk3o3H3C91m3V5JXwKx4ge3Vf\nprKn53St+//nFYqQ6IReeFr2qUZZ7DNANBbWdBC7T21HV+phqo7zMvrnKkhr\nPsuGBBgr7lfVITzSGbgfoUJoxEgWD+gvsISOd/W3MzB4BezZWa9liMTb0Q1K\nhfIyZXBV2A/YiQkDrsaAzm01JJDB3TjvI/rKCvIBo4ZkoVTYwM+zdlElqYmP\nfKejDnAnWuh+iK8ieNmCwk8ZeJUbXlfT8FTJwaQ2xM9pAtbt4zws2z4qU/bL\nE30nl1CfOhfIpkt5ye7hmnoSk38zO+x585cOhNs5whbaexi8hmxBROq58WgP\nuuo+vBtFx/SnkxppCByNnb36jfy8asCpKEetFm6r1Nlc7sC8NOZxi1zndvxb\nvuUtqZBzx0f8NszJPVHn0x6NSPPZmRpL8iwYNCxeRv+beDfu5SB5/UEIjKrR\nRQXSp/eT8qWcnzj6dOSv5Kkit+BtpAJa7sS4pCr5C0T5c6MO7FXclLnKfNDK\nbenTok47mPbR1/qmCrCVio8O1EJQUDmwQV8MPgSnUUYDZD4Ysuud6EYbl5IK\nPK6l\r\n=ZSPH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAjZDmmxCDQB9pxAYocErOSlxNq6xm9PJcDvOSbEnWm4AiEAw8/VQ24CHSMyFKacy0LFAbm/sx2btMoATVzMjySAEeY="}],"size":2407,"noattachment":false,"key":"/escape-goat/-/escape-goat-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_3.0.0_1579059189503_0.99336165635811"},"_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":1579059189631,"_cnpm_publish_time":1579059189631,"dist-tags":{"latest":"4.0.0"}}