UNPKG

372 BMarkdownView Raw
1# htmlescape
2
3Proper 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
8var htmlescape = require('htmlescape');
9htmlescape({prop:'value'});
10//=> '{"prop":"value"}'
11```