UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

22 lines (21 loc) 542 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.asciiArtify = void 0; /** * Converts text into boxed ASCII art (useful for CLI tools). * * Example: * asciiArtify("hi") → * +----+ * | hi | * +----+ * * @author @dailker * @param {string} str - The input string. * @returns {string} The ASCII art string. */ function asciiArtify(str) { const line = '+' + '-'.repeat(str.length + 2) + '+'; return `${line}\n| ${str} |\n${line}`; } exports.asciiArtify = asciiArtify;