UNPKG

debt-collector

Version:

a nodejs tool to identify, track and mesure technical debt

25 lines (24 loc) 925 B
import fs from 'fs'; import chartTemplate from './chartTemplate.js'; const cachePath = `${process.cwd()}/node_modules/.cache/debt-collector`; const buildWalkReport = ({ userConfig, tags, results, endDateEstimations, reportName, reportsLinks, }) => { setTimeout(() => { // waiting for file system to correctly switch all files after checkout const resultPath = `${cachePath}/report-${reportName}.html`; const jsonResults = JSON.stringify({ initialConfig: userConfig, reportsLinks, tags, results, endDateEstimations, }, null, 2); const data = chartTemplate(jsonResults); // const data = jsonResults fs.mkdir(cachePath, { recursive: true }, (err) => { if (err) throw err; fs.writeFileSync(resultPath, data); }); }, 330); }; export default buildWalkReport;