本文整理匯總了TypeScript中Process.stdout類的典型用法代碼示例。如果您正苦於以下問題:TypeScript stdout類的具體用法?TypeScript stdout怎麽用?TypeScript stdout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了stdout類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
commands.forEach((command: any) => {
const flags = command.flags.filter((flag: ICommandFlag) => flag.type !== 'not-implemented');
stdout.write(optionStruct(command.name, flags, command.input));
stdout.write('\n\n');
stdout.write(requestStruct(command.name));
stdout.write('\n\n');
stdout.write(methods(command.name));
stdout.write('\n\n');
stdout.write(inputMethod(command.name, command.input));
stdout.write('\n\n');
stdout.write(handleMethod(command.name, command.input));
stdout.write('\n\n');
stdout.write(optionsMethod(command.name, flags));
stdout.write('\n\n');
});
示例2:
powershell.on('stdout', (buffer: Buffer) => {
process.stdout.write(buffer);
});
示例3: require
const { argv, stdout } = require('process');
import { readFileSync, writeFileSync } from 'fs';
import ICommandFlag from '../client/icommandflag.ts';
const PACKAGE = 'package main';
const IMPORTS = [ 'errors', 'fmt', 'encoding/json', 'strconv' ];
const commands = JSON.parse(readFileSync(argv[2], 'utf8'));
stdout.write(PACKAGE);
stdout.write('\n\n');
stdout.write(imports());
stdout.write('\n\n');
stdout.write(runCommandRequest(commands));
stdout.write('\n\n');
commands.forEach((command: any) => {
const flags = command.flags.filter((flag: ICommandFlag) => flag.type !== 'not-implemented');
stdout.write(optionStruct(command.name, flags, command.input));
stdout.write('\n\n');
stdout.write(requestStruct(command.name));
stdout.write('\n\n');
stdout.write(methods(command.name));
stdout.write('\n\n');
stdout.write(inputMethod(command.name, command.input));
stdout.write('\n\n');
stdout.write(handleMethod(command.name, command.input));
stdout.write('\n\n');
stdout.write(optionsMethod(command.name, flags));
stdout.write('\n\n');
});