escape-xml
v1.0.2
Published
**Escape XML in javascript (NodeJS)**
Readme
Escape XML in javascript (NodeJS)
Escapes the invalid Markup characters: &, <, >, ", ' .
You could also always use CDATA escaping: <![CDATA[ .... ]]> especially with larger data.
npm install escape-xml
var xmlescape = require('escape-xml');
xmlescape(' Hello & Good Bye');
//return value
"Hello & Good Bye"
If you also need to ignore some characters on purpose you can find a similar package here
