{"_id":"htmlescape","_rev":"81602","name":"htmlescape","description":"Properly escape JSON for usage as an object literal inside of a `<script>` tag","dist-tags":{"latest":"1.1.1"},"maintainers":[{"name":"zertosh","email":""}],"time":{"modified":"2021-06-03T10:26:02.000Z","created":"2014-09-28T04:55:57.593Z","1.1.1":"2016-03-23T02:17:18.890Z","1.1.0":"2015-04-12T21:53:04.584Z","1.0.0":"2014-09-28T22:41:09.849Z","0.0.1":"2014-09-28T04:55:57.593Z"},"users":{"nickeltobias":true,"tobiasnickel":true,"cheapsteak":true,"rubiadias":true,"icodeforcookies":true},"author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"repository":{"type":"git","url":"git://github.com/zertosh/htmlescape.git"},"versions":{"1.1.1":{"name":"htmlescape","version":"1.1.1","description":"Properly escape JSON for usage as an object literal inside of a `<script>` tag","keywords":["escape","encoding","html","json","template"],"homepage":"https://github.com/zertosh/htmlescape","license":"MIT","author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"main":"htmlescape.js","repository":{"type":"git","url":"git://github.com/zertosh/htmlescape.git"},"scripts":{"test":"tape test/*.js"},"dependencies":{},"devDependencies":{"tape":"^3.0.0"},"engines":{"node":">=0.10"},"gitHead":"02dbcc367dd3069b73253ac08d87a40d37984239","bugs":{"url":"https://github.com/zertosh/htmlescape/issues"},"_id":"htmlescape@1.1.1","_shasum":"3a03edc2214bca3b66424a3e7959349509cb0351","_from":".","_npmVersion":"3.7.3","_nodeVersion":"5.9.0","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"dist":{"shasum":"3a03edc2214bca3b66424a3e7959349509cb0351","size":2611,"noattachment":false,"key":"/htmlescape/-/htmlescape-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlescape/download/htmlescape-1.1.1.tgz"},"maintainers":[{"name":"zertosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/htmlescape-1.1.1.tgz_1458699438386_0.6642345392610878"},"directories":{},"publish_time":1458699438890,"_cnpm_publish_time":1458699438890,"_hasShrinkwrap":false},"1.1.0":{"name":"htmlescape","version":"1.1.0","description":"Properly escape JSON for usage as an object literal inside of a `<script>` tag","keywords":["escape","encoding","html","json","template"],"homepage":"https://github.com/zertosh/htmlescape","licence":"MIT","author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"main":"htmlescape.js","repository":{"type":"git","url":"git://github.com/zertosh/htmlescape.git"},"scripts":{"test":"tape test/*.js"},"dependencies":{},"devDependencies":{"tape":"^3.0.0"},"engines":{"node":">=0.10"},"gitHead":"06156f88adccb5a2a5b9c7dd14628a931f96541d","bugs":{"url":"https://github.com/zertosh/htmlescape/issues"},"_id":"htmlescape@1.1.0","_shasum":"ebf7a9524f7c86b5f6888589b40bdba712eafa67","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"maintainers":[{"name":"zertosh","email":""}],"dist":{"shasum":"ebf7a9524f7c86b5f6888589b40bdba712eafa67","size":1189,"noattachment":false,"key":"/htmlescape/-/htmlescape-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlescape/download/htmlescape-1.1.0.tgz"},"directories":{},"publish_time":1428875584584,"_cnpm_publish_time":1428875584584,"_hasShrinkwrap":false},"1.0.0":{"name":"htmlescape","version":"1.0.0","description":"Properly escape JSON for usage as an object literal inside of a `<script>` tag","keywords":["escape","encoding","html","json","template"],"homepage":"https://github.com/zertosh/htmlescape","licence":"MIT","author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"main":"htmlescape.js","repository":{"type":"git","url":"git://github.com/zertosh/htmlescape.git"},"scripts":{"test":"tape test/*.js"},"dependencies":{},"devDependencies":{"tape":"^3.0.0"},"engines":{"node":">=0.10"},"gitHead":"c60271799d85183151bed4ca8fbe99cf0cc2e546","bugs":{"url":"https://github.com/zertosh/htmlescape/issues"},"_id":"htmlescape@1.0.0","_shasum":"bdc7670dbb7e011353474232bc5a0bbb42bb661e","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"maintainers":[{"name":"zertosh","email":""}],"dist":{"shasum":"bdc7670dbb7e011353474232bc5a0bbb42bb661e","size":1116,"noattachment":false,"key":"/htmlescape/-/htmlescape-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlescape/download/htmlescape-1.0.0.tgz"},"directories":{},"publish_time":1411944069849,"_cnpm_publish_time":1411944069849,"_hasShrinkwrap":false},"0.0.1":{"name":"htmlescape","version":"0.0.1","description":"htmlescape","keywords":["escape","encoding","html","json","template"],"homepage":"https://github.com/zertosh/htmlescape","licence":"MIT","author":{"name":"Andres Suarez","email":"zertosh@gmail.com"},"main":"htmlescape.js","repository":{"type":"git","url":"git://github.com/zertosh/htmlescape.git"},"scripts":{"test":"tape test/*.js"},"dependencies":{},"devDependencies":{"tape":"^3.0.0"},"engines":{"node":">=0.10"},"gitHead":"0527ca7156a524d256101bb310a9f970f63078ad","bugs":{"url":"https://github.com/zertosh/htmlescape/issues"},"_id":"htmlescape@0.0.1","_shasum":"6f5b3f606204e0f29c11c210747de350c6c20b38","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"zertosh","email":"zertosh@gmail.com"},"maintainers":[{"name":"zertosh","email":""}],"dist":{"shasum":"6f5b3f606204e0f29c11c210747de350c6c20b38","size":991,"noattachment":false,"key":"/htmlescape/-/htmlescape-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/htmlescape/download/htmlescape-0.0.1.tgz"},"directories":{},"publish_time":1411880157593,"_cnpm_publish_time":1411880157593,"_hasShrinkwrap":false}},"readme":"# htmlescape\n\nProperly escape JSON for usage as an object literal inside of a `<script>` tag. Use `htmlescape` in place of `JSON.stringify`. For more info see [JSON: The JavaScript subset that isn't](http://timelessrepo.com/json-isnt-a-javascript-subset).\n\n## Transformations\n\n| from     | to        |\n| -------- |:---------:|\n| `&`      | `\\\\u0026` |\n| `>`      | `\\\\u003e` |\n| `<`      | `\\\\u003c` |\n| `\\u2028` | `\\\\u2028` |\n| `\\u2029` | `\\\\u2029` |\n\n\n## Usage\n\n```js\nvar htmlescape = require('htmlescape');\nhtmlescape({prop:'value'});\n//=> '{\"prop\":\"value\"}'\n```\n\nOr in your templates:\n\n```html\n<script>\nvar payload = <%= htmlescape(payload) %>;\n</script>\n```\n","_attachments":{},"homepage":"https://github.com/zertosh/htmlescape","bugs":{"url":"https://github.com/zertosh/htmlescape/issues"},"license":"MIT"}