本文整理汇总了TypeScript中terminal-kit.terminal.green方法的典型用法代码示例。如果您正苦于以下问题:TypeScript terminal.green方法的具体用法?TypeScript terminal.green怎么用?TypeScript terminal.green使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类terminal-kit.terminal
的用法示例。
在下文中一共展示了terminal.green方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
term.fileInput({ baseDir: "../" }, (error: any, input: any) => {
if (error) {
term.red.bold(`'\nAn error occurs: ' + ${error} + '\n'`);
} else {
term.green("\nYour file is '%s'\n", input);
}
});
示例2: question
(error: any, result: any) => {
if (result) {
term.green("'Yes' detected! Good bye!\n");
} else {
term.red("'No' detected, are you sure?\n");
question();
}
}
示例3: term
// The term() function simply output a string to stdout, using current style
// output "Hello world!" in default terminal's colors
t.terminal("Hello world!\n");
// This output 'red' in red
term.red("red");
// This output 'bold' in bold
term.bold("bold");
// output 'mixed' using bold, underlined & red, exposing the style-mixing syntax
term.bold.underline.red("mixed");
// printf() style formatting everywhere:
// this will output 'My name is Jack, I'm 32.' in green
term.green("My name is %s, I'm %d.\n", "Jack", 32);
// Since v0.16.x, style markup are supported as a shorthand.
// Those two lines produce the same result.
term("My name is ")
.red("Jack")(" and I'm ")
.green("32\n");
term("My name is ^rJack^ and I'm ^g32\n");
// Width and height of the terminal
term("The terminal size is %dx%d", term.width, term.height);
// Move the cursor at the upper-left corner
term.moveTo(1, 1);
// We can always pass additional arguments that will be displayed...