UNPKG

@constructor-io/constructorio-connect-cli

Version:

CLI tool to enable users to interface with the Constructor Connect Ecosystem

30 lines (29 loc) 1.09 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.renderTip = renderTip; const core_1 = require("@oclif/core"); const kleur_1 = __importDefault(require("kleur")); /** * New line character with the necessary spacing to align the text on the terminal. */ const NEW_LINE_WITH_SPACING = "\n "; /** * New line character with spacing to align on the terminal, when breaking the first line. */ const FIRST_LINE_WITH_SPACING = "\n "; /** * Prints a tip to the user to provide helpful information. * It'll automatically insert the tip emoji (💡) and auto align the lines on the terminal. */ function renderTip(lines, { breakFirstLine = false, emoji = "💡" } = {}) { lines[0] = `${emoji} ${lines[0]}`; let message = ""; if (breakFirstLine) { message += FIRST_LINE_WITH_SPACING; } message += lines.join(NEW_LINE_WITH_SPACING); core_1.ux.stdout(kleur_1.default.gray(message)); }