evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A command-line tool that programmatically generates markdown documentation from JSDoc-annotated JavaScript files.
Build a Node.js command-line application that:
The tool should accept the following command-line arguments:
--output or -o flag followed by the output file path (default: API.md)Example usage:
node doc-builder.js src/utils.js src/helpers.js --output docs/api.mdThe tool should handle the following error scenarios:
/**
* Main entry point for the documentation builder CLI tool.
* Parses command-line arguments, generates documentation, and writes output.
*/
async function main() {
// IMPLEMENTATION HERE
}
/**
* Displays usage information for the CLI tool.
*/
function showUsage() {
// IMPLEMENTATION HERE
}
// Execute main function if run as a script
if (require.main === module) {
main().catch(error => {
console.error('Error:', error.message);
process.exit(1);
});
}
module.exports = { main, showUsage };Provides markdown documentation generation from JSDoc annotations.
Provides file system operations for reading and writing files.