You can also install js-htmlencode by using Bower.
Converts a string to an HTML-encoded string.