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

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

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

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



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

示例1: 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


示例2: aggregateResults

      Promise.then(function(results) {
        const aggregatedResult = aggregateResults(results);

        if (!testEnv) {
          if (aggregatedResult.errorCount === 0) {
            console.log(
              colors.green(
                'Successfully generated ' +
                  aggregatedResult.successCount +
                  ' objects.',
              ),
            );
          } else {
            console.log(
              colors.red(
                'Successfully generated ' +
                  aggregatedResult.successCount +
                  ' objects. Encountered ' +
                  aggregatedResult.errorCount +
                  ' errors in other files',
              ),
            );
            process.exit(1);
          }

          ParallelProcessQueue.shutDown();
        }
      }, promise);
开发者ID:facebook,项目名称:remodel,代码行数:28,代码来源:main.ts


示例3: 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


示例4: 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


示例5: serverPrintInfo

function serverPrintInfo() {
    return console.log(C.white('Welcome to') + " " + 
        C.green(config.SITE_NAME) + " " + C.white('server') + " " + 
        "" + C.green("V" + config.VERSION_MAJOR + "." + config.VERSION_MINOR + "." + config.VERSION_COUNTER)
    );
};
开发者ID:ludamad,项目名称:boarders,代码行数:6,代码来源:main.ts


示例6: showField

    public static showField(game: goita.Game, turn: number) {
        const player = game.board.players[turn];
        if (player.no % 2 === 0) {
            console.write("your team:" + clc.green(game.scores[0]) + " opponent:" + clc.green(game.scores[1]) + "\n");
        } else {
            console.write("opponent:" + clc.green(game.scores[0]) + " your team:" + clc.green(game.scores[1]) + "\n");
        }
        console.write("round: " + game.roundCount + "\n");
        console.write("------------------------\n");

        const history = new Array<string>();
        history.push("p1 ", "p2 ", "p3 ", "p4 ");
        for (let i = 0; i < game.board.history.dealer; i++) {
            history[i] += "|     ";
        }
        for (let i = 0; i < game.board.history.moveStack.length; i++) {
            const m = game.board.history.moveStack[i];
            const p = goita.Util.shiftTurn(i % 4, game.board.history.dealer);
            let hs = "";
            if (m.pass) {
                hs = clc.blackBright("なし");
            } else if (m.faceDown) {
                hs = goita.Koma.hidden.Text + m.attack.Text;
                hs = clc.cyanBright(hs);
            } else {
                hs = m.block.Text + m.attack.Text;
                hs = clc.cyanBright(hs);
            }
            history[p] += "| " + hs;
        }
        for (const h of history) {
            console.write(h);
            console.write("\n");
        }
        console.write("------------------------\n");
        const pLabel = new Array<string>();
        const bLine = new Array<goita.Koma[]>();
        const aLine = new Array<goita.Koma[]>();
        const empty = "_";

        for (const p of game.board.players) {
            const l = "p" + (p.no + 1) + ":";
            pLabel.push(l);
            const b = p.field.filter((k, i) => i % 2 === 0);
            bLine.push(b);
            const a = p.field.filter((k, i) => i % 2 !== 0);
            aLine.push(a);
        }

        const pNo = goita.Util.shiftTurn(player.no, 2);
        console.write("    ");
        console.write(pLabel[pNo]);
        for (const a of aLine[pNo].reverse()) {
            console.write(clc.cyan(a === goita.Koma.empty ? empty : a.Text));
        }
        console.write("\n");
        console.write("       ");
        for (const b of bLine[pNo].reverse()) {
            console.write(clc.cyan(b === goita.Koma.empty ? empty : b.Text));
        }
        console.write("\n");

        const lOpNo = goita.Util.shiftTurn(player.no, -1);
        const rOpNo = goita.Util.shiftTurn(player.no, 1);

        console.write(pLabel[lOpNo]);
        console.write("             ");
        console.write(pLabel[rOpNo]);
        console.write("\n");
        const laLine = aLine[lOpNo].map((k) => k === goita.Koma.empty ? empty : k.Text);
        const lbLine = bLine[lOpNo].map((k) => k === goita.Koma.empty ? empty : k.Text);
        const raLine = aLine[rOpNo].map((k) => k === goita.Koma.empty ? empty : k.Text);
        const rbLine = bLine[rOpNo].map((k) => k === goita.Koma.empty ? empty : k.Text);

        for (let i = 0; i < 4; i++) {
            let s = "";
            s += laLine[i];
            s += lbLine[i];
            s += "            ";
            s += rbLine[3 - i];
            s += raLine[3 - i];
            console.write(clc.cyan(s));
            console.write("\n");
        }

        console.write("    ");
        console.write(pLabel[player.no]);
        for (const b of bLine[player.no]) {
            console.write(clc.cyan(b === goita.Koma.empty ? empty : b.Text));
        }
        console.write("\n");
        console.write("       ");
        for (const a of aLine[player.no]) {
            console.write(clc.cyan(a === goita.Koma.empty ? empty : a.Text));
        }
        console.write("\n");

        console.write("------------------------\n");
    }
开发者ID:Goita,项目名称:goita-cli,代码行数:99,代码来源:cui.ts


示例7: success

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



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript cli-color.red函数代码示例发布时间:2022-05-24
下一篇:
TypeScript cli-color.cyan函数代码示例发布时间: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