forked from 1337programming/webpack-shell-plugin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
28 lines (22 loc) · 739 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const chalk = require('chalk');
const log = console.log;
// combine styled and normal strings
log(chalk.blue('Hello') + 'World' + chalk.red('!'));
// compose multiple styles using the chainable API
log(chalk.blue.bgRed.bold('Hello world!'));
// pass in multiple arguments
log(chalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz'));
// nest styles
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
// nest styles of the same type even (color, underline, background)
log(chalk.green(
'I am a green line ' +
chalk.blue.underline.bold('with a blue substring') +
' that becomes green again!'
));
// ES2015 template literal
log(`
CPU: ${chalk.red('90%')}
RAM: ${chalk.green('40%')}
DISK: ${chalk.yellow('70%')}
`);