Package Exports
- xml-escape
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 (xml-escape) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
xml-escape
Escape XML in javascript (NodeJS)
npm install xml-escape
// Warning escape is a reserved word, so maybe best to use xmlescape for var name
var xmlescape = require('xml-escape');
xmlescape('"hello" \'world\' & false < true > -1');
// output
// '"hello" 'world' & false < true > -1'
// don't escape some characters
xmlescape('"hello" \'world\' & false < true > -1', '>"&')
// output
// '"hello" 'world' & false < true > -1'
There is also now an ignore function thanks to @jayflo
esc = require('./');
ignore = '"<&'
// note you should never ignore an &
output = esc('I am "<¬>" escaped', ignore)
console.log(output)
//I am "<¬>" escaped