Skip to content

Instantly share code, notes, and snippets.

@joemaller
Created April 1, 2019 21:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joemaller/790e48429a0afa33ba9067eeb07b62ae to your computer and use it in GitHub Desktop.
Save joemaller/790e48429a0afa33ba9067eeb07b62ae to your computer and use it in GitHub Desktop.
dumb little reporting helper
const banner = (str = "", len = 100, pad = "-") => {
if (str.length > len) return str;
const out = new Array(len);
out.splice(Math.floor((len - str.length - 1) / 2), 0, ` ${str} `);
return `\n${out.join(pad).substring(0, len)}`;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment