Closed c3-ThomasHuo closed 3 years ago
Hi @c3-ThomasHuo,
Thank you very much for your suggestion.
I have implemented your request in axe-html-reporter@2.2.3.
Please install latest version: npm i -D axe-html-reporter@2.2.3
Suggestion on how to use this library if you don't need a report file but need only HTML it produces:
const reportHTML = createHtmlReport({
results: rawAxeResults,
options: {
projectKey: 'I need only raw HTML',
doNotCreateReportFile: true, // optional, you still can get full HTML content in response and also generate HTML file
},
});
console.log('reportHTML will have full content of HTML file.');
// suggestion on how to create file by yourself
if (!fs.existsSync('build/reports/saveReportHere.html')) {
fs.mkdirSync('build/reports', {
recursive: true,
});
}
fs.writeFileSync('build/reports/saveReportHere.html', reportHTML);
It would be great if users had the option of returning the HTML file generated instead of explicitly saving it! Should be a quick add to index.ts