Sample code for 30+ languages & platforms
Node.js

HTML Encoding

Demonstrates HTML encoding and decoding.

Chilkat Node.js Downloads

Node.js
NODEJS_PRELUDE

function chilkatExample() {

    var crypt = new chilkat.Crypt2();

    var s = "< é ü ç Ω Hello & World ✓ >";

    var htmlEncoded = crypt.EncodeString(s,"utf-8","html");
    console.log(htmlEncoded);

    //  Output:
    //  < &eacute; &uuml; &ccedil; &ohm; Hello & World &check; >

    //  To decode:
    s = crypt.DecodeString(htmlEncoded,"utf-8","html");
    console.log(s);

    //  Output:
    //  < é ü ç Ω Hello & World ✓ >

}

chilkatExample();