1 | # htmlescape
|
2 |
|
3 | Proper escaping of 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).
|
4 |
|
5 | ## Usage
|
6 |
|
7 | ```js
|
8 | var htmlescape = require('htmlescape');
|
9 | htmlescape({prop:'value'});
|
10 | //=> '{"prop":"value"}'
|
11 | ```
|