const terminalMarkdown = require('../utils/terminal-markdown');

let silent = false;

/**
 * @param {string[]} content
 * @returns {string}
 */
function print(...content) {
  const output = terminalMarkdown(content.join(' ')).trim();

  /* Print content to screen */
  if (!silent) {
    console.log(output);
  }

  return output;
}

print.silenced = (value) => {
  silent = value;
};

module.exports = print;
