-->
Installation
To use this middleware, first install it using npm or yarn:
npm install xss-middleware
or
yarn add xss-middleware
Usage
To use this middleware in your Express.js application, simply require or import it and add it to your middleware stack:
const express = require('express');
const xssMiddleware = require('xss-middleware');
const app = express();
app.use(xssMiddleware());
You can also pass options to the middleware to customize its behavior. See the xss documentation for available options.
const express = require('express');
const xssMiddleware = require('xss-middleware');
const app = express();
app.use(xssMiddleware({
whiteList: {
a: ['href', 'title', 'target'],
img: ['src', 'alt'],
}
}));
License
xss-middleware is licensed under the MIT License. See LICENSE for more information.