Détail du package

encode-html

intesso248MIT1.0.1

encode html entities

html, encode, entities

readme

encode-html

  • encode html entities
  • tiny function that replaces "<", ">", "''", "&" with html entities

install

npm install encode-html

use

var encode = require('encode-html');

console.log(encode('<div class="hidden">NON&SENSE\'s</div>'));
// -> '&lt;div class="hidden"&gt;NON&amp;SENSE&apos;s&lt;/div&gt;'

(opposite) decode function decode-html

test

npm test

license

MIT

author

Andi Neck | @andineck | intesso