@aclab/ac-banner
v0.0.2
Published
Create ASCII art banners for use in CLI applications or VS-Code extensions.
Downloads
5
Maintainers
Readme
AC Banner
Crie faixas de arte ASCII para uso em aplicativos CLI ou extensões VS-Code.
Instalação
npm install ac-banner
Uso com classe de dados
const data: TDataBanner = new TDataBanner();
data.displayName = "AC Banner";
data.version = "1.0.0";
data.authorName = "Alan Cândido";
data.authorEmail = "[email protected]";
const banner: string[] = buildBanner("Test", data);
console.log(banner.join('\n'));
Saída:
'----------------------------------v---------------------',
' ////// /////// ////// ////// | AC Banner',
' // // // // | 1.0.0',
' // ///// ////// // | ',
' // // // // | Alan Cândido',
' // /////// ////// // | [email protected]',
'----------------------------------^---------------------'
Uso com extensão VS-Code or dado em formato JSON
const ext: any = vscode.extensions.getExtension("brodao2.ac-banner");
const banner: string[] = buildBanner("Test", ext.packageJSON);
console.log(banner.join('\n'));
Saída:
'----------------------------------v---------------------',
' ////// /////// ////// ////// | AC Banner',
' // // // // | 1.0.0',
' // ///// ////// // | ',
' // // // // | Alan Cândido',
' // /////// ////// // | [email protected]',
'----------------------------------^---------------------'
API
/**
* Builds a banner string array from the provided title and data.
*
* @param title - The title to be displayed in the banner.
* @param data - The data to be displayed in the banner. Can be a `TDataBanner` object or a plain object with the required properties.
* @param options - Optional options for building the title.
* @returns An array of strings representing the banner.
*/
export function buildBanner(title: string, data: TDataBanner | {}, options?: TBuildTitleOptions): string[] {