1.0.2 • Published 3 years ago

escape-xml v1.0.2

Weekly downloads
-
License
SEE LICENSE IN ./...
Repository
-
Last release
3 years ago

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 &amp; Good Bye"

If you also need to ignore some characters on purpose you can find a similar package here