本文整理汇总了TypeScript中chalk.green类的典型用法代码示例。如果您正苦于以下问题:TypeScript green类的具体用法?TypeScript green怎么用?TypeScript green使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了green类的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
//.........这里部分代码省略.........
console.log(" browse = ", crawler.browseCounter);
console.log(" browseNext = ", crawler.browseNextCounter);
console.log(" transaction = ", crawler.transactionCounter);
if (false) {
// todo : treeify.asTree performance is *very* slow on large object, replace with better implementation
// xx console.log(treeify.asTree(obj, true));
treeify.asLines(obj, true, true, (line: string) => {
console.log(line);
});
}
}
client.removeListener("receive_response", print_stat);
// -----------------------------------------------------------------------------------------------------------------
// enumerate all Condition Types exposed by the server
// -----------------------------------------------------------------------------------------------------------------
console.log("--------------------------------------------------------------- Enumerate all Condition Types exposed by the server");
const conditionTree = await enumerateAllConditionTypes(the_session);
console.log(treeify.asTree(conditionTree));
console.log(" -----------------------------------------------------------------------------------------------------------------");
// -----------------------------------------------------------------------------------------------------------------
// enumerate all objects that have an Alarm & Condition instances
// -----------------------------------------------------------------------------------------------------------------
const alarms = await enumerateAllAlarmAndConditionInstances(the_session);
console.log(" -------------------------------------------------------------- Alarms & Conditions ------------------------");
for (const alarm of alarms) {
console.log(
"parent = ",
chalk.cyan(w(alarm.parent.toString(), 30)),
chalk.green.bold(w(alarm.typeDefinitionName, 30)),
"alarmName = ",
chalk.cyan(w(alarm.browseName.toString(), 30)),
chalk.yellow(w(alarm.alarmNodeId.toString(), 40))
);
}
console.log(" -----------------------------------------------------------------------------------------------------------------");
// -----------------------------------------------------------------------------------------------------------------
// Testing if server implements QueryFirst
// -----------------------------------------------------------------------------------------------------------------
try {
console.log(" ---------------------------------------------------------- Testing QueryFirst");
const queryFirstRequest: QueryFirstRequestOptions = {
view: {
viewId: NodeId.nullNodeId
},
nodeTypes: [
{
typeDefinitionNode: makeExpandedNodeId("i=58"),
includeSubTypes: true,
dataToReturn: [{
attributeId: AttributeIds.AccessLevel,
relativePath: undefined
}]
}
]};
const queryFirstResult = await the_session.queryFirst(queryFirstRequest);
示例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);
}