UNPKG

api-scout

Version:

šŸ” Automatically scout, discover and generate beautiful interactive API documentation from your codebase. Supports Express.js, NestJS, FastAPI, Spring Boot with interactive testing and security analysis.

31 lines (24 loc) • 965 B
const chalk = require('chalk'); const APIDocsGenerator = require('../index'); module.exports = async function watchCommand(options) { console.log(chalk.cyan('šŸ‘€ Starting watch mode...')); try { const generator = new APIDocsGenerator(options); // Initial generation console.log(chalk.yellow('šŸ“ Generating initial documentation...')); await generator.generate(); // Start watching await generator.watch(); console.log(chalk.green('āœ… Watch mode active! Documentation will update on file changes.')); console.log(chalk.gray('šŸ’” Press Ctrl+C to stop watching')); // Keep process alive process.on('SIGINT', () => { console.log(chalk.yellow('\nšŸ‘‹ Stopping watch mode...')); process.exit(0); }); } catch (error) { console.error(chalk.red('āŒ Failed to start watch mode:')); console.error(error.message); process.exit(1); } };