0.0.2 • Published 11 months ago

@aclab/ac-banner v0.0.2

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
11 months ago

AC Banner

GitHub Stars GitHub Top Language GitHub Workflow Status GitHub Last Commit GitHub License GitHub issues GitHub forks

All Contributors

English

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 = "brodao@gmail.com";

    const banner: string[] = buildBanner("Test", data);
    console.log(banner.join('\n'));

Saída:

      '----------------------------------v---------------------',
      ' //////  ///////  //////  //////  | AC Banner',
      '   //    //       //        //    | 1.0.0',
      '   //    /////    //////    //    | ',
      '   //    //           //    //    | Alan Cândido',
      '   //    ///////  //////    //    | brodao@gmail.com',
      '----------------------------------^---------------------'

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',
      '   //    ///////  //////    //    | brodao@gmail.com',
      '----------------------------------^---------------------'

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[] {
0.0.2

11 months ago