ent
v2.2.1
Published
Encode and decode HTML entities
Downloads
23,148,728
Readme
ent
Encode and decode HTML entities
example
var ent = require('ent');
console.log(ent.encode('<span>©moo</span>'))
console.log(ent.decode('π & ρ'));
<span>©moo</span>
π & ρ
methods
encode(str)
Escape unsafe characters in str
with html entities.
decode(str)
Convert html entities in str
back to raw text.
credits
HTML entity tables shamelessly lifted from perl's HTML::Entities
install
With npm do:
npm install ent
license
MIT