Add a new ES6 example using tagged template string
This commit is contained in:
parent
5a69476142
commit
b597d19435
1 changed files with 9 additions and 0 deletions
|
|
@ -76,6 +76,15 @@ CPU: ${chalk.red('90%')}
|
||||||
RAM: ${chalk.green('40%')}
|
RAM: ${chalk.green('40%')}
|
||||||
DISK: ${chalk.yellow('70%')}
|
DISK: ${chalk.yellow('70%')}
|
||||||
`);
|
`);
|
||||||
|
|
||||||
|
// ES2015 using [tagged template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals)
|
||||||
|
const { red, yellow, green } = chalk;
|
||||||
|
log(`
|
||||||
|
CPU: ${red.bold`90%`}
|
||||||
|
RAM: ${green`40%`}
|
||||||
|
DISK: ${yellow`70%`}
|
||||||
|
`);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Easily define your own themes.
|
Easily define your own themes.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue