with-banner.js 537 B

1234567891011121314151617
  1. /**
  2. * @param {string} title
  3. * @param {string[]} description
  4. * @param {Date} date
  5. * @param {string[]} content
  6. * @returns {string}
  7. */
  8. const withBanner = (title, description, date, content) => {
  9. return `########################################
  10. # ${title}
  11. ${description.map(line => `# ${line}`).join('\n')}
  12. # Last Updated: ${date.toISOString()}
  13. # Size: ${content.length}
  14. ########################################\n` + content.join('\n') + '\n################# END ###################\n';
  15. };
  16. module.exports.withBanner = withBanner;