当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ansi-colors.magenta函数代码示例

本文整理汇总了TypeScript中ansi-colors.magenta函数的典型用法代码示例。如果您正苦于以下问题:TypeScript magenta函数的具体用法?TypeScript magenta怎么用?TypeScript magenta使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了magenta函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: mapFile

  function mapFile(file: vinyl, cb: map.INewDataCallback): void {
    const filepath = colors.magenta(path.relative(process.cwd(), file.path));
    const formatted = format(filepath);

    if (formatted) {
      log(formatted);
    }

    cb(null, file);
  }
开发者ID:alexgorbatchev,项目名称:gulp-print,代码行数:10,代码来源:gulp-print.ts

示例2: done

 stream.on('end', () => {
   chai.expect(logStub).to.have.been.calledWith(`Hello ${colors.magenta(path.relative(process.cwd(), filepath))}`);
   done();
 });
开发者ID:alexgorbatchev,项目名称:gulp-print,代码行数:4,代码来源:gulp-print.test.ts

示例3:

	const showErrorCount = (count: number, type: string) => {
		if (count === 0) return;

		console.log('TypeScript:', colors.magenta(count.toString()), (type !== '' ? type + ' ' : '') + (count === 1 ? 'error' : 'errors'));
		hasError = true;
	};
开发者ID:ivogabe,项目名称:gulp-typescript,代码行数:6,代码来源:reporter.ts

示例4:

import * as colors from 'ansi-colors';

let s: string;

s = colors.bgblack("hello");
s = colors.bgblue("hello");
s = colors.bgcyan("hello");
s = colors.bggreen("hello");
s = colors.bgmagenta("hello");
s = colors.bgred("hello");
s = colors.bgwhite("hello");
s = colors.bgyellow("hello");
s = colors.black("hello");
s = colors.blue("hello");
s = colors.bold("hello");
s = colors.cyan("hello");
s = colors.dim("hello");
s = colors.gray("hello");
s = colors.green("hello");
s = colors.grey("hello");
s = colors.hidden("hello");
s = colors.inverse("hello");
s = colors.italic("hello");
s = colors.magenta("hello");
s = colors.red("hello");
s = colors.reset("hello");
s = colors.strikethrough("hello");
s = colors.underline("hello");
s = colors.white("hello");
s = colors.yellow("hello");
开发者ID:AlexGalays,项目名称:DefinitelyTyped,代码行数:30,代码来源:ansi-colors-tests.ts

示例5: log

function log(): void {
	const errors = _.flatten(allErrors);
	const seen = new Set<string>();

	errors.map(err => {
		if (!seen.has(err)) {
			seen.add(err);
			fancyLog(`${ansiColors.red('Error')}: ${err}`);
		}
	});

	const regex = /^([^(]+)\((\d+),(\d+)\): (.*)$/;
	const messages = errors
		.map(err => regex.exec(err))
		.filter(match => !!match)
		.map(x => x as string[])
		.map(([, path, line, column, message]) => ({ path, line: parseInt(line), column: parseInt(column), message }));

	try {

		fs.writeFileSync(buildLogPath, JSON.stringify(messages));
	} catch (err) {
		//noop
	}

	fancyLog(`Finished ${ansiColors.green('compilation')} with ${errors.length} errors after ${ansiColors.magenta((new Date().getTime() - startTime!) + ' ms')}`);
}
开发者ID:PKRoma,项目名称:vscode,代码行数:27,代码来源:reporter.ts

示例6: logSuccess

export function logSuccess(file: WorkFile) {
  console.log(c.magenta(basename(file.distScss)), c.green(c.symbols.check));
}
开发者ID:MurhafSousli,项目名称:ng2-sharebuttons,代码行数:3,代码来源:utils.ts


注:本文中的ansi-colors.magenta函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。