Features:
XSS is a module used to filter input from users to prevent XSS attacks. (What is XSS attack?)
This module is needed for situations that allows users to input HTML for typesetting or formatting, including fourms, blogs, e-shops, etc.
The xss module controls the usage of tags and their attributes, according to the whitelist. It is also extendable with a series of APIs privided, which make it become more flexible, compares with other modules.
Install:
$ npm install xss --save
Usage:
var xss = require('xss');
console.log(xss('<a href="#" onclick="alert(/xss/)">click me</a>'));
Require Script File:
https://raw.github.com/leizongmin/js-xss/master/dist/xss.js
Usage:
console.log(filterXSS('<a href="#" onclick="alert(/xss/)">click me</a>'));