本文整理汇总了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');
});