UNPKG

stack-exchange-markdown-retriever

Version:

Retrieves the markdown for a question or answer on a stack exchange site.

17 lines (13 loc) 650 B
var program = require('commander'); var markdownRetriever = require('.'); program .usage('[options] <entityId>') .option('-a, --answer', 'Retrieve the markdown of an answer, rather than a question') .option('-s, --site [site]', 'The base url for stack exchange site that you wish to query (ie. "scifi.stackexchange.com")') .option('-k, --apiKey [key]', 'Use an api key when accessing the stack api, which should allow more downloads') .parse(process.argv); function logResultToConsole(result) { console.log(result); } program.entityId = program.args[0]; markdownRetriever.retrieveMarkdown(program, logResultToConsole);