本文整理汇总了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());
}
});
示例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')}
`
示例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`
)
}
}
示例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');
}
});
示例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.
`
示例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'))
}
})
示例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);
});
示例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"));
}
示例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)}'`)
}
}
示例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);
});
}