{"name":"escape-goat","version":"2.1.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":">=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":"77f2219474d9680d8039c2f8e2649f11900e7e09","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@2.1.0","_nodeVersion":"8.16.0","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"integrity":"sha512-7fMXQmS/6yjYQT/yydWKCAm5ucuU7QtqP6/CE7BIKk6z3xTP4MLqkdUBwaViQVuTAde8yZgZIjSnEAPRl6u53g==","shasum":"0f55d3fa1d41a4175fc7a26e25bdb5b2d1afbe31","tarball":"http://registry-npm.ywwl.com/escape-goat/download/escape-goat-2.1.0.tgz","fileCount":5,"unpackedSize":6274,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc75/qCRA9TVsSAnZWagAAj7MP/2UWy6az6LpGYLzf/SLZ\n1sKsNXgUC6lNau23meAr7d18i0/QNhdea4ZGQAmk4tkPYId0uOHphhJOWNIX\nE/tozwhnXNs8H9RWm3o6mGZXnP/FcmoqXy8LiVPiWn79R6Ddvpo1Hp3n5NJ/\nVcb8IZNJphA5Uc4JszMcOxCgjhd4OQFHW2vN2aieLIhA1FFw0cBzLxfwVXKG\nzXGSK4TZjbVkvZkG8VpTjwPEckgaR25o71A7u1lco/Gba9X1/VByoooxf89l\n5Hu/UZp06gLvT3qfrxPLb6nqcPOepvCwTU02TjVRNhrDGrFTrgKJkhv+t1IS\n09v/cnbzE2fDWoixYr/rsUGVHVIveMQRoivIzlgrxIVp0Yc9Vtht/gmYlL0g\nuYtjt0/q0MBNVMZPRUHDd+omr9V20my6LH224V33LVfmLoFB93L18pHvudh5\nuvKEoc0ymv7hTo6w4TxOyfuqrCMeAaBjIaRa/mxNPDdQjcKVZOxH24gGs0kI\nQYP9hBErtDR8efT3mOtjNMqhMpjw9UV5yQBJFqqXLOuA7PDOmcTzvuvAbvRC\n63mpKBiTJqN6l1m6GBlj+De3n+b4ZpiQz6HeMFvtT95OOiX/kDA1oNZmXIXC\nn6ZLDDIMI8jSBS44zWKD3y44o/A/So5B7U3mXH4w5AxOQEbIvhLvQUVf0+EV\n3zC5\r\n=KK6M\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICvNmHMkZnS1M5f3ixn0Xa7dv2SFvAcxV38aU2vFHrYhAiEAmTcXqzI/92MktLtTnYXe3LD3JngWs8D80QcHXFX8thE="}],"size":2390,"noattachment":false,"key":"/escape-goat/-/escape-goat-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_2.1.0_1559207913846_0.7765709055891488"},"_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":1559207913981,"_cnpm_publish_time":1559207913981,"dist-tags":{"latest":"4.0.0"}}