xss-cli
v1.0.0
Published
smarty for xss check
Downloads
2
Readme
xss-cli
介绍
检测smarty文件里可能需要转义的地方
命令行使用
安装
npm install xss-cli -g
执行,检测目录下所有**/*.tpl
xss check ./src
API
安装
npm install xss-cli
使用
const xssCheck = require('xss-cli/dist/command/check');
const checkResults = xssCheck.checkContent(content);
if (checkResults && checkResults.length) {
console.log(`error count: ${checkResults.length}`);
for (const item of checkResults) {
console.log(` ${item}`);
}
} else {
console.log(`${chalk.green(file)} OK`);
}