Package Exports
- stringify-entities
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (stringify-entities) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
stringify-entities

Encode HTML character references and character entities.
Very fast;
Just the encoding part;
Reliable:
"`"characters are escaped to ensure no scripts execute in IE6-8. Additionally, only named entities recognized by HTML4 are encoded, meaning the infamous'(which people think is a virus) wonβt show up.
Installation
npm:
npm install stringify-entitiesstringify-entities is also available for duo, and bundled for AMD, CommonJS, and globals (uncompressed and compressed).
Usage
var stringify = require('stringify-entities');
stringify.encode('alpha Β© bravo β charlie π delta');Yields:
alpha © bravo ≠ charlie 𝌆 delta…and with useNamedReferences: true.
stringify.encode('alpha Β© bravo β charlie π delta', { useNamedReferences: true });Yields:
alpha © bravo ≠ charlie 𝌆 deltaAPI
stringifyEntities(value[, options?])
Encode special characters in value.
Parameters:
value(string) β Value to encode;options(Object?, optional) β Configuration:escapeOnly(boolean?, optional, default:false) β Whether to only escape possibly dangerous characters (",',<,>&, and`);useNamedReferences(boolean?, optional, default:false) β Whether to use entities where possible.
Returns: string, encoded value.
stringifyEntities.escape(value[, options?])
Escape special characters in value. Shortcut for stringifyEntities
with escapeOnly: true and useNamedReferences: true.
Support
See html.spec.whatwg.org.
License
MIT Β© Titus Wormer