{"_id":"escape-goat","_rev":"53965","name":"escape-goat","description":"Escape a string for use in HTML or the inverse","dist-tags":{"latest":"4.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2021-06-03T10:16:26.000Z","created":"2017-05-27T10:14:03.393Z","4.0.0":"2021-04-16T05:16:18.770Z","3.0.0":"2020-01-15T03:33:09.631Z","2.1.1":"2019-09-23T09:39:38.647Z","2.1.0":"2019-05-30T09:18:33.981Z","2.0.0":"2019-04-17T12:47:47.054Z","1.3.0":"2017-07-31T10:41:39.478Z","1.2.0":"2017-07-21T21:48:49.258Z","1.1.0":"2017-05-31T06:17:16.629Z","1.0.1":"2017-05-28T05:51:20.643Z","1.0.0":"2017-05-27T10:14:03.393Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/escape-goat.git"},"versions":{"4.0.0":{"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":{"shasum":"9424820331b510b0666b98f7873fe11ac4aa8081","size":2359,"noattachment":false,"key":"/escape-goat/-/escape-goat-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-4.0.0.tgz"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_4.0.0_1618550178623_0.7160660400657874"},"_hasShrinkwrap":false,"publish_time":1618550178770,"_cnpm_publish_time":1618550178770},"3.0.0":{"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":{"shasum":"e8b5fb658553fe8a3c4959c316c6ebb8c842b19c","size":2407,"noattachment":false,"key":"/escape-goat/-/escape-goat-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_3.0.0_1579059189503_0.99336165635811"},"_hasShrinkwrap":false,"publish_time":1579059189631,"_cnpm_publish_time":1579059189631},"2.1.1":{"name":"escape-goat","version":"2.1.1","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":"4d0dac2f019c9de3100615e2ba4ebace042bd604","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@2.1.1","_nodeVersion":"10.16.3","_npmVersion":"6.11.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"1b2dc77003676c457ec760b2dc68edb648188675","size":2392,"noattachment":false,"key":"/escape-goat/-/escape-goat-2.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-2.1.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_2.1.1_1569231578518_0.37111587499704446"},"_hasShrinkwrap":false,"publish_time":1569231578647,"_cnpm_publish_time":1569231578647},"2.1.0":{"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":{"shasum":"0f55d3fa1d41a4175fc7a26e25bdb5b2d1afbe31","size":2390,"noattachment":false,"key":"/escape-goat/-/escape-goat-2.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-2.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_2.1.0_1559207913846_0.7765709055891488"},"_hasShrinkwrap":false,"publish_time":1559207913981,"_cnpm_publish_time":1559207913981},"2.0.0":{"name":"escape-goat","version":"2.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"},"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":"235683eb791e13336cf4bd9705ea9df97e0d8e51","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"8.15.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"be9120096b3002eae301ea9db824247d688121b9","size":2387,"noattachment":false,"key":"/escape-goat/-/escape-goat-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat_2.0.0_1555505266932_0.924764560779894"},"_hasShrinkwrap":false,"publish_time":1555505267054,"_cnpm_publish_time":1555505267054},"1.3.0":{"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":{"shasum":"bf3ee8ad1e488fbba404b084b2e4a55e09231c64","size":2118,"noattachment":false,"key":"/escape-goat/-/escape-goat-1.3.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-1.3.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat-1.3.0.tgz_1501497698607_0.654048390686512"},"directories":{},"publish_time":1501497699478,"_hasShrinkwrap":false,"_cnpm_publish_time":1501497699478},"1.2.0":{"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":{"shasum":"cea2d733ede4d9c2fd6b5fe83c83677de6d1807e","size":2136,"noattachment":false,"key":"/escape-goat/-/escape-goat-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-1.2.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat-1.2.0.tgz_1500673728312_0.22979621612466872"},"directories":{},"publish_time":1500673729258,"_hasShrinkwrap":false,"_cnpm_publish_time":1500673729258},"1.1.0":{"name":"escape-goat","version":"1.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":">=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":"5930869364f998ad1ea45c82018b7e423e8a9a38","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@1.1.0","_shasum":"9521cf4d561fbce5f6d79f97679bb1a2387b74af","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"9521cf4d561fbce5f6d79f97679bb1a2387b74af","size":1851,"noattachment":false,"key":"/escape-goat/-/escape-goat-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-1.1.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat-1.1.0.tgz_1496211436552_0.2925461393315345"},"directories":{},"publish_time":1496211436629,"_hasShrinkwrap":false,"_cnpm_publish_time":1496211436629},"1.0.1":{"name":"escape-goat","version":"1.0.1","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":"7a5b3d312ecbbd3660bacf01f54cf46031772218","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@1.0.1","_shasum":"07f7da38bb408b5c48b813333c815d74037c6ec8","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"07f7da38bb408b5c48b813333c815d74037c6ec8","size":1917,"noattachment":false,"key":"/escape-goat/-/escape-goat-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-1.0.1.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat-1.0.1.tgz_1495950680550_0.09076580125838518"},"directories":{},"publish_time":1495950680643,"_hasShrinkwrap":false,"_cnpm_publish_time":1495950680643},"1.0.0":{"name":"escape-goat","version":"1.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"},"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":"a195c6d5accc937612c691cb0ac159a9cfb91f79","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"homepage":"https://github.com/sindresorhus/escape-goat#readme","_id":"escape-goat@1.0.0","_shasum":"2062d48541ef51fdc4a8205d1bd4de2c88753dfa","_from":".","_npmVersion":"2.15.11","_nodeVersion":"7.10.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"2062d48541ef51fdc4a8205d1bd4de2c88753dfa","size":1926,"noattachment":false,"key":"/escape-goat/-/escape-goat-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/escape-goat/download/escape-goat-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/escape-goat-1.0.0.tgz_1495880043271_0.144944847561419"},"directories":{},"publish_time":1495880043393,"_cnpm_publish_time":1495880043393,"_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","_attachments":{},"homepage":"https://github.com/sindresorhus/escape-goat#readme","bugs":{"url":"https://github.com/sindresorhus/escape-goat/issues"},"license":"MIT"}