encode-html

    1.0.1 • Public • Published

    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

    Install

    npm i encode-html

    DownloadsWeekly Downloads

    78

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • andineck