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
JavaScript
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);
}
};