当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript cli-table.push函数代码示例

本文整理汇总了TypeScript中cli-table.push函数的典型用法代码示例。如果您正苦于以下问题:TypeScript push函数的具体用法?TypeScript push怎么用?TypeScript push使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了push函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: table

export function table(log: ILogLevels, options: ILogTableOptions = {}) {
  const { head = [], colWidths = [] } = options;
  const t = new Table({
    head: compact(head),
    colWidths,
  });
  const api: ILogTable = {
    /**
     * Adds a new row to the table.
     */
    add(columns: Array<string | number | undefined>) {
      t.push(columns.map(row => (row === undefined ? '' : row.toString())));
      return api;
    },

    /**
     * Converts the table to a string.
     */
    toString() {
      return t.toString();
    },

    /**
     * Logs the table to the console.
     */
    log() {
      log.info(api.toString());
      return api;
    },
  };
  return api;
}
开发者ID:philcockfield,项目名称:js-util-log,代码行数:32,代码来源:log.table.ts

示例2:

 customers.forEach((customer: any) => {
   table.push([
     customer.id,
     customer.companyProfile.companyName,
     customer.companyProfile.domain,
     customer.companyProfile.tenantId
   ]);
 });
开发者ID:PartnerCenterSamples,项目名称:partnercenter-restapi-nodejs,代码行数:8,代码来源:index.ts

示例3: logLeenaConfiguration

function logLeenaConfiguration (leenaConfiguration) : void {
  var table = new Table ({ });

  table.push (
    // Header
    [
      chalk.bold.green ('Service'),
      chalk.bold.green ('IP/Path'),
      chalk.bold.green ('Port')
    ],
    // Watcher info
    [
      'Watcher',
      leenaConfiguration.browserSync.watcher.server,
      [
        '{',
        leenaConfiguration.browserSync.watcher.port,
        ', ',
        leenaConfiguration.browserSync.watcher.uiPort,
        '}'
      ].join ('')
    ],
    // Web server info
    [
      'Web Server',
      leenaConfiguration.browserSync.webServer.server,
      [
        '{',
        leenaConfiguration.browserSync.webServer.port,
        ', ',
        leenaConfiguration.browserSync.webServer.uiPort,
        '}'
      ].join ('')
    ],
    // Chrome tester server info
    [
      'Chrome Tester Server',
      leenaConfiguration.chromeTester.testerServer.hostname,
      leenaConfiguration.chromeTester.testerServer.port
    ],
    // Chrome remote protocol info
    [
      'Chrome Remote Protocol',
      leenaConfiguration.chromeTester.debuggingProtocol.hostname,
      leenaConfiguration.chromeTester.debuggingProtocol.port
    ]
  );

  console.log (table.toString ());
}
开发者ID:mmicu,项目名称:leena,代码行数:50,代码来源:init.ts

示例4: resultsTable

function resultsTable(rows) {
    let result = "No results";
    if(rows.length) {
        let headers = Object.keys(rows[0]).filter((header) => header !== "__id");
        var table = new Table({head: headers});
        for(let row of rows) {
            let tableRow = [];
            for(let field of headers) {
                tableRow.push(row[field]);
            }
            table.push(tableRow);
        }
        result = table.toString();
    }
    return result;
}
开发者ID:AtnNn,项目名称:Eve,代码行数:16,代码来源:repl.ts

示例5: Table

            }).then(body => {
                let table = new Table({
                    chars: { 'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': '' },
                    colWidths: [26, 30, 15, 10],
                    head: ['Id', 'Name', 'Size', 'Accesses'],
                });

                for (let file of body) {
                    file.size = file.size ? filesize(file.size) : 'None';
                    table.push([
                        file._id, file.name, file.size, file.accesses || 'none',
                    ]);
                }

                console.log(table.toString());
                resolve();
            }, err => {
开发者ID:victorjacobs,项目名称:chullo-client,代码行数:17,代码来源:client.ts

示例6: Table

    instance.on('done', (result) => {
        let table = new Table({
            head: ['name', 'average', 'min', 'max']
        });

        table.push(
            ["Latency", result.latency.average, result.latency.min, result.latency.max],
            ["Req/Sec", result.requests.average, result.requests.min, result.requests.max]
        );

        console.log(table.toString());

        setTimeout(() => {
            child.removeAllListeners();
            child.kill();
            process.exit(0);
        }, 10)
    });
开发者ID:uditalias,项目名称:appolo,代码行数:18,代码来源:benchmarks.ts

示例7:

 domainList.forEach((item) => {
   table.push(item)
 })
开发者ID:wenwei1202,项目名称:dnspod-ddns,代码行数:3,代码来源:CommandExec.ts


注:本文中的cli-table.push函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。