Escape a string for use in HTML or the inverse
Install
$ npm install escape-goat复制代码
Usage
const escapeGoat = require('escape-goat'); escapeGoat.escape('?? & ??'); //=> '?? & ??' escapeGoat.unescape('?? & ??'); //=> '?? & ??' escapeGoat.escape('Hello World'); //=> 'Hello World'复制代码
API
escapeGoat.escape(input)
Escapes the following characters in the giveninputstring:&<>”‘
escapeGoat.unescape(html)
Unescapes the following HTML entities in the giveninputstring:&<>"'