UNPKG

y3-app

Version:
31 lines (30 loc) 1.44 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.displayBanner = displayBanner; const figlet_1 = __importDefault(require("figlet")); // import chalk from 'chalk'; const gradient_string_1 = __importDefault(require("gradient-string")); function displayBanner() { const rawFigletText = figlet_1.default.textSync('CREATE Y3 APP', { font: 'Big', horizontalLayout: 'default', verticalLayout: 'default', }); // how to center in the middle of the terminal // const terminalWidth = process.stdout.columns || 80; // Use a fallback if not a TTY // const lines = rawFigletText.split('\n'); // const processedPaddedLines = lines.map(line => { // const lineLength = line.length; // // Calculate padding for both sides to make the line span the full width // const totalPadding = Math.max(0, terminalWidth - lineLength); // const leftPadding = Math.floor(totalPadding / 2); // const rightPadding = totalPadding - leftPadding; // return ' '.repeat(leftPadding) + line + ' '.repeat(rightPadding); // }); // const paddedText = processedPaddedLines.join('\n'); const gradientText = (0, gradient_string_1.default)(['#00FFFF', '#FF00FF'])(rawFigletText); console.log(gradientText); }