• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript cli-color.yellow函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: startEmulator

export async function startEmulator(instance: EmulatorInstance): Promise<void> {
  const name = instance.getName();
  const info = instance.getInfo();

  // Log the command for analytics
  track("emulators:start", name);

  // TODO(samstern): This check should only occur when the host is localhost
  const portOpen = await checkPortOpen(info.port);
  if (!portOpen) {
    await cleanShutdown();
    utils.logWarning(`Port ${info.port} is not open, could not start ${name} emulator.`);
    utils.logBullet(`To select a different port for the emulator, update your "firebase.json":
    {
      // ...
      "emulators": {
        "${name}": {
          "port": "${clc.yellow("PORT")}"
        }
      }
    }`);
    return utils.reject(`Could not start ${name} emulator, port taken.`, {});
  }

  // Start the emulator, wait for it to grab its port, and then mark it as started
  // in the registry.
  await EmulatorRegistry.start(instance);
  await waitForPortClosed(info.port);
}
开发者ID:firebase,项目名称:firebase-tools,代码行数:29,代码来源:controller.ts


示例2: writeFiles

    private writeFiles(matches: Array<string>) {
        console.info(clc.yellow('Generating files:'));
        matches.forEach((match: string) => {
            let cleanedMatch = this.cleanModule(match);
            let fullFilePath = path.join(process.cwd(), this.config.proxyjs.outDir, `${match}.js`);
            // Make sure that all folders are created.
            mkdirp.sync(path.dirname(fullFilePath));

            // Get `require` relative path.
            let requireFileFullPath = path.join(process.cwd(), this.config.proxyjs.requireFile);
            let requireFileRelativePath = this.getRelativePath(fullFilePath, requireFileFullPath);

            console.log(fullFilePath);
            //Write to file
            let stream = fs.createWriteStream(fullFilePath, { 'flags': 'w' });
            let moduleName = Helpers.kebabCaseToPascalCase(cleanedMatch);
            stream.write(
                [
                    HEADER_COMMENT,
                    this.generateLine(requireFileRelativePath, moduleName)
                ].join('\r\n'));
            stream.end();
        });
        console.info(clc.green('Done generating files.'));
    }
开发者ID:QuatroCode,项目名称:dts-bundle-proxyjs,代码行数:25,代码来源:generator.ts


示例3: prettyFieldString

  /**
   * Get a colored, pretty-printed representation of a field
   */
  private prettyFieldString(field: API.Field): string {
    let result = "";

    const parsedName = util.parseFieldName(field.name);

    result +=
      "[" +
      clc.cyan(parsedName.collectionGroupId) +
      "." +
      clc.yellow(parsedName.fieldPath) +
      "] --";

    const fieldIndexes = field.indexConfig.indexes || [];
    if (fieldIndexes.length > 0) {
      fieldIndexes.forEach((index) => {
        const firstField = index.fields[0];
        const mode = firstField.order || firstField.arrayConfig;
        result += ` (${mode})`;
      });
    } else {
      result += " (no indexes)";
    }

    return result;
  }
开发者ID:firebase,项目名称:firebase-tools,代码行数:28,代码来源:indexes.ts


示例4: prettyIndexString

  /**
   * Get a colored, pretty-printed representation of an index.
   */
  private prettyIndexString(index: API.Index): string {
    let result = "";

    if (index.state) {
      const stateMsg = `[${index.state}] `;

      if (index.state === API.State.READY) {
        result += clc.green(stateMsg);
      } else if (index.state === API.State.CREATING) {
        result += clc.yellow(stateMsg);
      } else {
        result += clc.red(stateMsg);
      }
    }

    const nameInfo = util.parseIndexName(index.name);

    result += clc.cyan(`(${nameInfo.collectionGroupId})`);
    result += " -- ";

    index.fields.forEach((field) => {
      if (field.fieldPath === "__name__") {
        return;
      }

      // Normal field indexes have an "order" while array indexes have an "arrayConfig",
      // we want to display whichever one is present.
      const orderOrArrayConfig = field.order ? field.order : field.arrayConfig;
      result += `(${field.fieldPath},${orderOrArrayConfig}) `;
    });

    return result;
  }
开发者ID:firebase,项目名称:firebase-tools,代码行数:36,代码来源:indexes.ts


示例5: showHand

 public static showHand(game: goita.Game, turn: number, hidden: boolean) {
     const player = game.board.players[turn];
     const p = "p" + (player.no + 1);
     console.write(p + " hand: ");
     if (hidden) {
         const len = player.hand.length;
         let str = "";
         for (const h of player.hand.sort()) {
             if (h.value !== goita.Define.empty) {
                 str += "☗";
             }
         }
         console.write(clc.yellow(str));
     } else {
         console.write(clc.yellow(goita.KomaArray.toTextString(player.hand.sort())));
     }
     console.write("\n");
     console.write("------------------------\n");
 }
开发者ID:Goita,项目名称:goita-cli,代码行数:19,代码来源:cui.ts


示例6: zrfPrettyPrint

export function zrfPrettyPrint(V, indent = 0) {
    var clc = require("cli-color"), s = "", t = "";
    for (var i = 0; i < indent + 1; i++) {
        t += " ";
    }
    if (typeof V !== "object") {
        return (V != null ? V.toString() : clc.yellow("null")) + "\n";
    } else if (Array.isArray(V)) {
        s += "\n";
        V.forEach((v) => s += t + "- " + (zrfPrettyPrint(v, indent + 2)));
    } else {
        if (V._classname != null) {
            s += (clc.blue(V._classname)) + "\n";
        } else {
            s += "\n";
        }
        for (var k of Object.keys(V)) {
            if (V[k] != null) {
                s += t + " " + (clc.green(k)) + " " + (zrfPrettyPrint(V[k], indent + 1));
            }
        }
    }
    return s;
}
开发者ID:ludamad,项目名称:boarders,代码行数:24,代码来源:zrfUtils.ts


示例7: performanceDisplayInfo

function performanceDisplayInfo(time: Date, info: string): string {
  return colors.yellow('[perf][' + time + '] ' + info);
}
开发者ID:facebook,项目名称:remodel,代码行数:3,代码来源:file-logged-sequence-write-utils.ts


示例8: exitWithError

    static exitWithError(errorMessage: string) {

        console.log(
            color.yellow(
                "\n+----------------------------------------------+" +
                "\n|      ") + color.xterm(200).bold('An error occurred - Can\'t continue') + color.yellow("      |" +
            "\n+----------------------------------------------+") +
            "\n" +
            "\nError:\n" +
            color.red.bold(errorMessage) +
            "\n");
        process.exit(1);
    }
开发者ID:reasn,项目名称:mouflon,代码行数:13,代码来源:Utils.ts


示例9: deploy

    deploy() {
        var start = (new Date()).getTime(),
            deployPromise: Q.IPromise<boolean>,
            config = this.serviceContainer.config,
            packageData: any = JSON.parse('' + fs.readFileSync(__dirname + '/../../package.json'));

        this.serviceContainer.log.logAndKeepColors(
            color.yellow(
                "\n\n+----------------------------------------------------+" +
                "\n|      ") + color.xterm(200).bold('Mouflon - your deployment manager') + ' ' + ('        v' + packageData.version).substr(-10, 10) + color.yellow("  |" +
            "\n+----------------------------------------------------+") +
            "\n\n");

        this.serviceContainer.log.startSection(sprintf('Deploying "%s" to "%s"...', config.projectName, config.stageName));
        this.serviceContainer.log.debug('Timestamp is ' + color.whiteBright.bold(this.timestamp));
        if (this.serviceContainer.config.verbose) {
            this.serviceContainer.log.debug('Verbose mode is enabled');
        }
        this.serviceContainer.log.debug('Working paths: ' + this.serviceContainer.config.paths.getReadable());

        deployPromise = this.deployManager.deploy();

        deployPromise.then(
            () => {
                var end = (new Date()).getTime();
                this.serviceContainer.log.closeSection(sprintf(
                    'It took %ss to deploy "%s" to "%s". :)' + "\n\n",
                    (0.001 * (end - start)).toFixed(3),
                    config.projectName,
                    config.stageName
                ));
            },
            (error) => {
                Utils.exitWithError(error);
            }
        );
    }
开发者ID:reasn,项目名称:mouflon,代码行数:37,代码来源:Mouflon.ts


示例10: warn

 warn(msg: string) {
   this.messages_.push(this.color_ ? clc.yellow(msg) : msg);
 }
开发者ID:teppeis,项目名称:closure-ts,代码行数:3,代码来源:cli.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript cli-color.bold类代码示例发布时间:2022-05-24
下一篇:
TypeScript cli-color.xterm函数代码示例发布时间:2022-05-24
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap