Skip to content

Commit 7ea0b54

Browse files
author
victorsun
committed
upd
1 parent 7c5081a commit 7ea0b54

46 files changed

Lines changed: 8045 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11-构建工具/05-脚手架/01-csxiaoyao-cli/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
$ sudo npm link
2020
# 取消
2121
$ npm unlink
22+
$ npm link --force
2223
```
2324

2425
5. process.argv 接收命令行参数

11-构建工具/05-脚手架/04-ora加载工具/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "inquirer-study",
2+
"name": "ora-study",
33
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# 05-chalk 颜色处理
2+
3+
4+
```
5+
$ npm install chalk
6+
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env node
2+
3+
import chalk from 'chalk';
4+
5+
// const log = {
6+
// error(str) {
7+
// chalk.bold.red(str)
8+
// }
9+
// // your own themes
10+
// }
11+
const log = console.log;
12+
13+
// 文本颜色
14+
log(chalk.bold.red('csxiaoyao.com'));
15+
log(chalk.yellow('csxiaoyao.com'));
16+
log(chalk.green('csxiaoyao.com'));
17+
log(chalk.white('csxiaoyao.com'));
18+
log(chalk.grey('csxiaoyao.com'));
19+
log(chalk.hex('#DEADED').underline('Hello, world!'));
20+
log(chalk.red('Hello', chalk.underline.bgBlue('world') + '!'));
21+
22+
// 背景色
23+
log(chalk.bgRed('csxiaoyao.com'));
24+
log(chalk.bgBlue('csxiaoyao.com'));
25+
log(chalk.rgb(15, 100, 204).inverse('Hello!'))
26+
27+
// 模板字符串
28+
log(`
29+
CPU: ${chalk.red('90%')}
30+
RAM: ${chalk.green('40%')}
31+
DISK: ${chalk.yellow('70%')}
32+
`);
33+

0 commit comments

Comments
 (0)