docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A utility module for formatting text into fixed-width columns with custom alignment and padding characters.
/**
* Formats a string to a fixed width with center alignment
*
* @param {string} text - The text to format
* @param {number} width - The target width
* @param {string} [padChar=' '] - The character to use for padding
* @returns {string} The centered text
*/
function formatCenter(text, width, padChar = ' ');
/**
* Formats a string to a fixed width by adding padding to the left
*
* @param {string} text - The text to format
* @param {number} width - The target width
* @param {string} [padChar=' '] - The character to use for padding
* @returns {string} The left-padded text
*/
function formatLeft(text, width, padChar = ' ');
/**
* Formats a string to a fixed width by adding padding to the right
*
* @param {string} text - The text to format
* @param {number} width - The target width
* @param {string} [padChar=' '] - The character to use for padding
* @returns {string} The right-padded text
*/
function formatRight(text, width, padChar = ' ');
module.exports = {
formatCenter,
formatLeft,
formatRight
};Provides string manipulation utilities for padding text.