本文整理汇总了TypeScript中chalk.green.bold方法的典型用法代码示例。如果您正苦于以下问题:TypeScript green.bold方法的具体用法?TypeScript green.bold怎么用?TypeScript green.bold使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chalk.green
的用法示例。
在下文中一共展示了green.bold方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: log
export function log( type: 'title' | 'success' | 'error' | 'step' | 'substep' | 'default' = 'default', message: string = '' ): void {
switch( type ) {
case 'title':
console.log( chalk.white.bold.underline( message ) );
break;
case 'success':
console.log( chalk.green.bold( message ) );
break;
case 'error':
console.log( chalk.red.bold( message ) );
break;
case 'step':
console.log( chalk.white.bold( ` ${ message }` ) );
break;
case 'substep':
console.log( chalk.gray( ` ${ arrowSymbol } ${ message }` ) );
break;
default:
console.log( message );
}
}
示例2: linkProjectExecutables
if (project.isWorkspaceProject) {
log.write(`Skipping workspace project: ${project.name}`);
continue;
}
if (project.hasDependencies()) {
await project.installDependencies({ extraArgs });
}
}
}
log.write(chalk.bold('\nInstalls completed, linking package executables:\n'));
await linkProjectExecutables(projects, projectGraph);
/**
* At the end of the bootstrapping process we call all `kbn:bootstrap` scripts
* in the list of projects. We do this because some projects need to be
* transpiled before they can be used. Ideally we shouldn't do this unless we
* have to, as it will slow down the bootstrapping process.
*/
log.write(chalk.bold('\nLinking executables completed, running `kbn:bootstrap` scripts\n'));
await parallelizeBatches(batchedProjects, async pkg => {
if (pkg.hasScript('kbn:bootstrap')) {
await pkg.runScriptStreaming('kbn:bootstrap');
}
});
log.write(chalk.green.bold('\nBootstrapping completed!\n'));
},
};
示例3: require
require('postcss-import')(),
require('postcss-cssnext')({
browsers: ['> 1%', 'last 2 versions']
}),
require('postcss-reporter')({ clearMessages: true })
];
};;
export const PLUG_IN_PROGRESS = new ProgressBarPlugin({
clear: true,
width: 30,
summary: false,
incomplete: '😬 ',
complete: '😜 ',
customSummary: () => { },
format: ' [:bar] ' + chalk.green.bold(':percent'),
});
function fileLoaderFactory(
test: RegExp,
name: string,
limit: number,
mimeType: string = ''
): FileLoader {
return {
test: test,
loader: 'url-loader',
query: {
name: name,
limit: limit,
mimeType: mimeType
示例4: succ
public succ(message: string): void { // 何かに成功した状況で使う
this.log(chalk.blue.bold('INFO'), chalk.green.bold(message));
}
示例5: main
async function main() {
const optionsInitial = {
endpoint_must_exist: false,
keepSessionAlive: true,
connectionStrategy: {
initialDelay: 2000,
maxDelay: 10 * 1000,
maxRetry: 10
}
};
client = OPCUAClient.create(optionsInitial);
client.on("backoff", (retry: number, delay: number) => {
console.log(chalk.bgWhite.yellow("backoff attempt #"), retry, " retrying in ", delay / 1000.0, " seconds");
});
console.log(" connecting to ", chalk.cyan.bold(endpointUrl));
console.log(" strategy", client.connectionStrategy);
await client.connect(endpointUrl);
const endpoints = await client.getEndpoints();
if (argv.debug) {
fs.writeFileSync("tmp/endpoints.log", JSON.stringify(endpoints, null, " "));
console.log(treeify.asTree(endpoints, true));
}
const table = new Table();
let serverCertificate: Certificate;
let i = 0;
for (const endpoint of endpoints) {
table.cell("endpoint", endpoint.endpointUrl + "");
table.cell("Application URI", endpoint.server.applicationUri);
table.cell("Product URI", endpoint.server.productUri);
table.cell("Application Name", endpoint.server.applicationName.text);
table.cell("Security Mode", endpoint.securityMode.toString());
table.cell("securityPolicyUri", endpoint.securityPolicyUri);
table.cell("Type", ApplicationType[endpoint.server.applicationType]);
table.cell("certificate", "..." /*endpoint.serverCertificate*/);
endpoint.server.discoveryUrls = endpoint.server.discoveryUrls || [];
table.cell("discoveryUrls", endpoint.server.discoveryUrls.join(" - "));
serverCertificate = endpoint.serverCertificate;
const certificate_filename = path.join(__dirname, "../certificates/PKI/server_certificate" + i + ".pem");
if (serverCertificate) {
fs.writeFile(certificate_filename, toPem(serverCertificate, "CERTIFICATE"), () => {/**/
});
}
table.newRow();
i++;
}
console.log(table.toString());
for (const endpoint of endpoints) {
console.log("Identify Token for : Security Mode=", endpoint.securityMode.toString(), " Policy=", endpoint.securityPolicyUri);
const table2 = new Table();
for (const token of endpoint.userIdentityTokens!) {
table2.cell("policyId", token.policyId);
table2.cell("tokenType", token.tokenType.toString());
table2.cell("issuedTokenType", token.issuedTokenType);
table2.cell("issuerEndpointUrl", token.issuerEndpointUrl);
table2.cell("securityPolicyUri", token.securityPolicyUri);
table2.newRow();
}
console.log(table2.toString());
}
await client.disconnect();
// reconnect using the correct end point URL now
console.log(chalk.cyan("Server Certificate :"));
console.log(chalk.yellow(hexDump(serverCertificate!)));
const options = {
securityMode,
securityPolicy,
serverCertificate,
defaultSecureTokenLifetime: 40000,
endpoint_must_exist: false,
connectionStrategy: {
initialDelay: 2000,
maxDelay: 10 * 1000,
maxRetry: 10
}
};
console.log("Options = ", options.securityMode.toString(), options.securityPolicy.toString());
client = OPCUAClient.create(options);
console.log(" reconnecting to ", chalk.cyan.bold(endpointUrl));
//.........这里部分代码省略.........
示例6: echoGreenInfo
public echoGreenInfo(outputText: string) {
console.log(chalk.green.bold("%s"), ">> " + outputText);
}
示例7: linkProjectExecutables
await project.installDependencies({ extraArgs });
}
}
}
console.log(
chalk.bold('\nInstalls completed, linking package executables:\n')
);
await linkProjectExecutables(projects, projectGraph);
/**
* At the end of the bootstrapping process we call all `kbn:bootstrap` scripts
* in the list of projects. We do this because some projects need to be
* transpiled before they can be used. Ideally we shouldn't do this unless we
* have to, as it will slow down the bootstrapping process.
*/
console.log(
chalk.bold(
'\nLinking executables completed, running `kbn:bootstrap` scripts\n'
)
);
await parallelizeBatches(batchedProjects, async pkg => {
if (pkg.hasScript('kbn:bootstrap')) {
await pkg.runScriptStreaming('kbn:bootstrap');
}
});
console.log(chalk.green.bold('\nBootstrapping completed!\n'));
},
};
示例8: send_response
/**
* @method send_response
* @async
* @param msgType
* @param response
* @param message
* @param callback
*/
public send_response(
msgType: string,
response: Response,
message: Message,
callback?: ErrorCallback
): void {
const request = message.request;
const requestId = message.requestId;
if (this.aborted) {
debugLog("channel has been terminated , cannot send responses");
return callback && callback(new Error("Aborted"));
}
// istanbul ignore next
if (doDebug) {
assert(response.schema);
assert(request.schema);
assert(requestId > 0);
// verify that response for a given requestId is only sent once.
if (!this.__verifId) {
this.__verifId = {};
}
assert(!this.__verifId[requestId], " response for requestId has already been sent !! - Internal Error");
this.__verifId[requestId] = requestId;
}
if (doPerfMonitoring) {
// record tick : send response received.
this._tick2 = get_clock_tick();
}
assert(this.securityToken);
let options = {
channelId: this.securityToken.channelId,
chunkSize: this.transport.receiveBufferSize,
requestId,
tokenId: this.securityToken.tokenId
};
const securityOptions =
msgType === "OPN" ? this._get_security_options_for_OPN() : this._get_security_options_for_MSG();
options = _.extend(options, securityOptions);
response.responseHeader.requestHandle = request.requestHeader.requestHandle;
/* istanbul ignore next */
if (0 && doDebug) {
console.log(" options ", options);
analyze_object_binary_encoding(response as any as BaseUAObject);
}
/* istanbul ignore next */
if (doTraceMessages) {
console.log(
chalk.cyan.bold("xxxx >>>> ---------------------------------------- "),
chalk.green.bold(response.schema.name),
requestId
);
console.log(response.toString());
console.log(chalk.cyan.bold("xxxx >>>> ----------------------------------------|\n"));
}
if (this._on_response) {
this._on_response(msgType, response, message);
}
this._transactionsCount += 1;
this.messageChunker.chunkSecureMessage(
msgType,
options as ChunkMessageOptions,
response as any as BaseUAObject,
(messageChunk: Buffer | null) => {
return this._send_chunk(callback, messageChunk);
});
}
示例9: function
export default async function(source: string, destination: string, replacements: Object): Promise<void> {
console.info(chalk.green.bold(' create ') + destination);
const str = await ejsRender(source, replacements);
await writeRenderedFile(str, destination);
}