INNER CODE UNIT · JavaScript

presentCount

nadimtuhin/claude-token-optimizer · src/commands/audit.js:230

  const presentCount = ESSENTIAL_FILES.filter(f => fs.existsSync(path.join(dir, f))).length;
  results.push(check(
    `Essential files present (${presentCount}/${ESSENTIAL_FILES.length})`,
    presentCount === ESSENTIAL_FILES.length,
    'info',
    presentCount < ESSENTIAL_FILES.length ? 'Run: cto init  (or: cto audit --fix)' : null,
    'essential-files',
  ));

  const docsIndexExists = fs.existsSync(path.join(dir, 'docs', 'INDEX.md'));
  results.push(check('docs/INDEX.md present', docsIndexExists, 'info',
    docsIndexExists ? null : 'Run: cto init  (or: cto audit --fix)', 'docs-index'));

  return results;
}

export async function auditCommand(options) {
  const dir = process.cwd();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…