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


TypeScript chalk.cyan函数代码示例

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


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

示例1: if

    eventFields.map((key: string) => {

        const variant = eventData[key];
        if (!variant || variant.dataType === DataType.Null) {
            return;
        }
        if (variant.dataType === DataType.ByteString) {
            console.log(w("", 20), chalk.yellow(w(key, 15)),
              chalk.cyan(w(DataType[variant.dataType], 10).toString()),
              variant.value.toString("hex"));

        } else if (variant.dataType === DataType.NodeId) {

            const node = addressSpace.findNode(variant.value);
            const name = node ? node.browseName.toString() : variant.value.toString();

            console.log(chalk.yellow(w(name, 20), w(key, 15)),
              chalk.cyan(w(DataType[variant.dataType], 10).toString()),
              chalk.cyan.bold(name), "(", w(variant.value, 20), ")");

        } else {
            console.log(w("", 20),
              chalk.yellow(w(key, 15)),
              chalk.cyan(w(DataType[variant.dataType], 10).toString()),
              variant.value.toString());
        }
    });
开发者ID:node-opcua,项目名称:node-opcua,代码行数:27,代码来源:utest_limit_alarm.ts

示例2: developers

export const usageRoot = (showQuickstart: boolean) => `
  Serverless GraphQL backend for frontend developers (${chalk.underline('https://www.graph.cool')})
  
  ${chalk.dim('Usage:')} ${chalk.bold('graphcool')} [command]

  ${chalk.dim('Commands:')}${showQuickstart ? `
    quickstart    Open Graphcool Quickstart examples`: ''}
    init          Create a new project
    push          Push project file changes
    pull          Download the latest project file
    export        Export project data
    endpoints     Print GraphQL endpoints
    console       Open Graphcool Console
    playground    Open GraphQL Playground
    projects      List projects
    delete        Delete existing projects
    auth          Sign up or login
    version       Print version
    
  Run 'graphcool COMMAND --help' for more information on a command.
  
  ${chalk.dim('Examples:')}
  
  ${chalk.gray('-')} Initialize a new Graphcool project
    ${chalk.cyan('$ graphcool init')}
  
  ${chalk.gray('-')} Local setup of an existing project
    ${chalk.cyan('$ graphcool pull -p <project-id | alias>')}
    
  ${chalk.gray('-')} Update live project with local changes
    ${chalk.cyan('$ graphcool push')}
    
`
开发者ID:sadeeqaji,项目名称:graphcool-cli,代码行数:33,代码来源:usage.ts

示例3: verifyWorkspaceContainsDirectory

// Verifies that the test workspace contains the given directory
export default async function verifyWorkspaceContainsDirectory(
  args: ActionArgs
) {
  const directory = args.nodes.text()
  const fullPath = path.join(args.configuration.workspace, directory)
  args.formatter.name(
    `verifying the ${chalk.bold(
      chalk.cyan(directory)
    )} directory exists in the test workspace`
  )
  args.formatter.log(`ls ${fullPath}`)
  let stats
  try {
    stats = await fs.lstat(fullPath)
  } catch (err) {
    throw new Error(
      `directory ${chalk.cyan(
        chalk.bold(directory)
      )} does not exist in the test workspace`
    )
  }
  if (!stats.isDirectory()) {
    throw new Error(
      `${chalk.cyan(chalk.bold(directory))} exists but is not a directory`
    )
  }
}
开发者ID:Originate,项目名称:tutorial-runner,代码行数:28,代码来源:verify-workspace-contains-directory.ts

示例4:

app.listen(port, () => {
  if (process.env.NODE_ENV === 'development') {
    if (process.env.GRAPHIQL) {
      console.log('The GraphiQL App is running at:');
      console.log();
      console.log(`  ${chalk.cyan(`http://localhost:${port}/${paths.GRAPHIQL_PATH }`)}`);
    } else {
      console.log('The Koa App is running at:');
      console.log();
      console.log(`  ${chalk.cyan(`http://localhost:${port}`)}`);
    }
    if (process.env.VOYAGER) {
      if (process.env.GRAPHIQL) {
        console.log();
      }
      console.log('The GraphQL Voyager App is running at:');
      console.log();
      console.log(`  ${chalk.cyan(`http://localhost:${port}/${paths.VOYAGER_PATH}`)}`);
    }
    if (process.env.PLAYGROUND) {
      if (process.env.GRAPHIQL || process.env.VOYAGER) {
        console.log();
      }
      console.log('The GraphQL Plaground App is running at:');
      console.log();
      console.log(`  ${chalk.cyan(`http://localhost:${port}/${paths.PLAYGROUND_PATH}`)}`);
    }
  } else {
    console.log('The Koa App is running');
  }
});
开发者ID:Alexandr-Baluhin,项目名称:nodejs-graphql-template,代码行数:31,代码来源:server.ts

示例5:

export const unknownOptionsWarning = (command: string, unknownOptions: string[]) => unknownOptions.length > 1 ? `\
${chalk.bold('Error:')} The following options are not recognized: ${chalk.red(`${unknownOptions.map(a => a)}`)}
Use ${chalk.cyan(`\`graphcool ${command} --help\``)} to see a list of all possible options.
` : `\
${chalk.bold('Error:')} The following option is not recognized: ${chalk.red(`${unknownOptions[0]}`)}
Use ${chalk.cyan(`\`graphcool ${command} --help\``)} to see a list of all possible options.
`
开发者ID:sadeeqaji,项目名称:graphcool-cli,代码行数:7,代码来源:constants.ts

示例6: getServeSpinner

 compiler.hooks.done.tap('taroDoneFirst', stats => {
   if (isFirst) {
     isFirst = false
     getServeSpinner().clear()
     console.log()
     console.log(chalk.cyan(`ℹ️  Listening at ${urls.lanUrlForTerminal}`))
     console.log(chalk.cyan(`ℹ️  Listening at ${urls.localUrlForBrowser}`))
     console.log(chalk.gray('\n监听文件修改中...\n'))
   }
 })
开发者ID:ApolloRobot,项目名称:taro,代码行数:10,代码来源:index.ts

示例7: it

        it('should return a cyan-styled percentage', () => {
            const reporter = new LzhReporter({});

            let styled = reporter._getStyledPercentage(100, 89);
            let expected = chalk.cyan('11%');
            expect(styled).to.eq(expected);

            styled = reporter._getStyledPercentage(100, 80);
            expected = chalk.cyan('20%');
            expect(styled).to.eq(expected);
        });
开发者ID:winseros,项目名称:gulp-armapbo-plugin,代码行数:11,代码来源:lzhReporter.spec.ts

示例8: dump_request

// istanbul ignore next
function dump_request(request: Request, requestId: number, channelId: number) {
    console.log(
      chalk.cyan("xxxx   <<<< ---------------------------------------- "),
      chalk.yellow(request.schema.name),
      "requestId",
      requestId,
      "channelId=",
      channelId
    );
    console.log(request.toString());
    console.log(chalk.cyan("xxxx   <<<< ---------------------------------------- \n"));
}
开发者ID:node-opcua,项目名称:node-opcua,代码行数:13,代码来源:server_secure_channel_layer.ts

示例9: build_graph

  function build_graph(task: Task<any>): void {
    nodes.add(task)

    for (const dep of task.deps) {
      const task_dep = tasks.get(dep)
      if (task_dep != null) {
        edges.push([task_dep, task]) // before -> after
        build_graph(task_dep)
      } else
        throw new Error(`unknown task '${chalk.cyan(dep)}' referenced from '${chalk.cyan(name)}'`)
    }
  }
开发者ID:HuntJSparra,项目名称:bokeh,代码行数:12,代码来源:task.ts

示例10: main

async function main() {

    const server = new OPCUAServer(server_options);

    server.on("post_initialize", () => {
        /* empty */
    });

    console.log(chalk.yellow("  server PID          :"), process.pid);
    console.log(chalk.yellow("  silent              :"), argv.silent);

    await server.start();

    const endpointUrl = server.endpoints[0].endpointDescriptions()[0].endpointUrl!;
    console.log(chalk.yellow("  server on port      :"), chalk.cyan(server.endpoints[0].port.toString()));
    console.log(chalk.yellow("  endpointUrl         :"), chalk.cyan(endpointUrl));

    console.log(chalk.yellow("\n  server now waiting for connections. CTRL+C to stop"));

    if (argv.silent) {
        console.log("silent");
        console.log = (...args: [any?, ... any[]]) => {
            /* silent */
        };
    }

    server.on("create_session", (session: ServerSession) => {
        console.log(" SESSION CREATED");
        console.log(chalk.cyan("    client application URI: "), session.clientDescription!.applicationUri);
        console.log(chalk.cyan("        client product URI: "), session.clientDescription!.productUri);
        console.log(chalk.cyan("   client application name: "), session.clientDescription!.applicationName.toString());
        console.log(chalk.cyan("   client application type: "), session.clientDescription!.applicationType.toString());
        console.log(chalk.cyan("              session name: "), session.sessionName ? session.sessionName.toString() : "<null>");
        console.log(chalk.cyan("           session timeout: "), session.sessionTimeout);
        console.log(chalk.cyan("                session id: "), session.nodeId);
    });

    server.on("session_closed", (session: ServerSession, reason: string) => {
        console.log(" SESSION CLOSED :", reason);
        console.log(chalk.cyan("              session name: "), session.sessionName ? session.sessionName.toString() : "<null>");
    });

    process.on("SIGINT", async () => {
        // only work on linux apparently
        console.error(chalk.red.bold(" Received server interruption from user "));
        console.error(chalk.red.bold(" shutting down ..."));
        await server.shutdown(1000);
        console.error(chalk.red.bold(" shot down ..."));
        process.exit(1);
    });

}
开发者ID:node-opcua,项目名称:node-opcua,代码行数:52,代码来源:simple_secure_server.ts


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