0

如何在 Node JS 的 Chalk 中增加字体大小?我想用我的代码做到这一点。这显然是英格兰国旗,但我想在下面添加一些文字,说它要回家了。不知道看过很多 gits 和论坛,但找不到任何已经问过的东西。

const chalk = new require('chalk').constructor({ enabled: true, level: 3 });

console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);

console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);

console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.red.bgRed
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.red.bgRed('...........................')
);
console.log(
        chalk.red.bgRed
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.red.bgRed('...........................')
);
console.log(
        chalk.red.bgRed
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.red.bgRed('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
console.log(
        chalk.white.bgWhite
    ('...........................') +
      chalk.red.bgRed('2222222') +
        chalk.white.bgWhite('...........................')
);
4

1 回答 1

0

你不能。

chalk使用ANSI 转义码工作,并且没有(便携式)代码可以更改字体大小。

于 2018-07-18T19:05:31.087 回答