Skip to content

Commit 7ab9ddf

Browse files
committed
feat: add package.json cheatsheet.
1 parent 5234cdc commit 7ab9ddf

File tree

16 files changed

+715
-110
lines changed

16 files changed

+715
-110
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Quick Reference
1717
## 工具包
1818

1919
[npm](./docs/npm.md)
20+
[package.json](./docs/package.json.md)
2021
[VSCode](./docs/vscode.md)
2122
[Sketch](./docs/sketch.md)
2223
[Jest](./docs/jest.md)

docs/cron.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ Min Hour Day Mon Weekday
8484

8585

8686
### 特殊字符
87-
<!--rehype:warp-class=col-span-2-->
87+
<!--rehype:wrap-class=col-span-2-->
8888

8989
<!--rehype:-->
9090
| 特殊字符 | 说明 |

docs/git.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $ git clone git_url 指定目录
2727
```
2828

2929
### 做出改变
30-
<!--rehype:warp-class=row-span-2-->
30+
<!--rehype:wrap-class=row-span-2-->
3131

3232
<!--rehype:-->
3333
在工作目录中**显示**修改后的文件,为您的下一次提交暂存
@@ -368,10 +368,10 @@ $ git log -p <file_name>
368368
```shell
369369
$ git log --pretty=oneline --graph --decorate --all
370370
```
371-
<!--rehype:className=wrap-->
371+
<!--rehype:className=wrap-text-->
372372

373373
### 分支
374-
<!--rehype:warp-class=row-span-2-->
374+
<!--rehype:wrap-class=row-span-2-->
375375

376376
列出所有分支及其上游
377377

@@ -442,7 +442,7 @@ $ git rm -r --cached <目录/文件>
442442
```
443443

444444
### 修改远程 Commit 记录
445-
<!--rehype:warp-class=row-span-4-->
445+
<!--rehype:wrap-class=row-span-4-->
446446

447447
<!--rehype:-->
448448
```shell
@@ -519,7 +519,7 @@ $ git rev-parse --short HEAD # e10721c
519519
```shell
520520
$ git branch --merged master | grep -v '^\*\| master' | xargs -n 1 git branch -d
521521
```
522-
<!--rehype:className=wrap-->
522+
<!--rehype:className=wrap-text-->
523523

524524
### 中文乱码的解决方案
525525

docs/javascript.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ let age = 7;
127127
```
128128

129129
### 字符串
130-
<!--rehype:warp-class=col-span-2-->
130+
<!--rehype:wrap-class=col-span-2-->
131131

132132
<!--rehype:-->
133133
```js
@@ -154,7 +154,7 @@ abc.split("");
154154
```
155155

156156
### 数字
157-
<!--rehype:warp-class=row-span-2-->
157+
<!--rehype:wrap-class=row-span-2-->
158158

159159
<!--rehype:-->
160160
```js
@@ -211,7 +211,7 @@ Math.floor(Math.random() * 5) + 1;
211211
```
212212

213213
### 全局函数
214-
<!--rehype:warp-class=col-span-2-->
214+
<!--rehype:wrap-class=col-span-2-->
215215

216216
<!--rehype:-->
217217
```js
@@ -247,7 +247,7 @@ JavaScript 条件
247247

248248

249249
### 操作符
250-
<!--rehype:warp-class=row-span-3-->
250+
<!--rehype:wrap-class=row-span-3-->
251251

252252
<!--rehype:-->
253253
```javascript
@@ -401,7 +401,7 @@ const rocketToMars = function() {
401401
```
402402
403403
### 箭头函数 (ES6)
404-
<!--rehype:warp-class=row-span-2-->
404+
<!--rehype:wrap-class=row-span-2-->
405405
406406
<!--rehype:-->
407407
#### 有两个参数
@@ -494,7 +494,7 @@ JavaScript 范围
494494
----
495495
496496
### 范围
497-
<!--rehype:warp-class=row-span-2-->
497+
<!--rehype:wrap-class=row-span-2-->
498498
499499
<!--rehype:-->
500500
```javascript
@@ -793,7 +793,7 @@ for (let index in fruits) {
793793
```
794794
795795
### label 语句
796-
<!--rehype:warp-class= row-span-2-->
796+
<!--rehype:wrap-class= row-span-2-->
797797
798798
<!--rehype:-->
799799
```js
@@ -827,7 +827,7 @@ for (let fruit of fruits) {
827827
```
828828
829829
### for await...of
830-
<!--rehype:warp-class= row-span-2-->
830+
<!--rehype:wrap-class= row-span-2-->
831831
832832
<!--rehype:-->
833833
```javascript
@@ -972,7 +972,7 @@ console.log(classElection.place); // undefined
972972
```
973973
974974
### 可变的
975-
<!--rehype:warp-class=row-span-2-->
975+
<!--rehype:wrap-class=row-span-2-->
976976
977977
<!--rehype:-->
978978
```javascript
@@ -1041,7 +1041,7 @@ console.log(origObj.color);
10411041
```
10421042
10431043
### 工厂函数
1044-
<!--rehype:warp-class=row-span-2-->
1044+
<!--rehype:wrap-class=row-span-2-->
10451045
10461046
<!--rehype:-->
10471047
```javascript
@@ -1119,7 +1119,7 @@ JavaScript Classes
11191119
----
11201120
11211121
### 静态方法/字段
1122-
<!--rehype:warp-class=row-span-2-->
1122+
<!--rehype:wrap-class=row-span-2-->
11231123
11241124
<!--rehype:-->
11251125
```javascript
@@ -1311,7 +1311,7 @@ JavaScript Promises
13111311
----
13121312
13131313
### Promise
1314-
<!--rehype:warp-class=row-span-2-->
1314+
<!--rehype:wrap-class=row-span-2-->
13151315
13161316
<!--rehype:-->
13171317
创建 promises
@@ -1416,7 +1416,7 @@ promise.catch((err) => {
14161416
```
14171417
14181418
### Promise.all()
1419-
<!--rehype:warp-class=col-span-2-->
1419+
<!--rehype:wrap-class=col-span-2-->
14201420
14211421
<!--rehype:-->
14221422
```javascript
@@ -1457,7 +1457,7 @@ promise.then(res => {
14571457
```
14581458
14591459
### 避免嵌套的 Promise 和 .then()
1460-
<!--rehype:warp-class=col-span-2-->
1460+
<!--rehype:wrap-class=col-span-2-->
14611461
14621462
<!--rehype:-->
14631463
```javascript
@@ -1484,7 +1484,7 @@ JavaScript Async-Await
14841484
<!--rehype:body-class=cols-2-->
14851485
14861486
### 异步
1487-
<!--rehype:warp-class=row-span-2-->
1487+
<!--rehype:wrap-class=row-span-2-->
14881488
14891489
<!--rehype:-->
14901490
```javascript
@@ -1611,7 +1611,7 @@ req.send();
16111611
```
16121612
16131613
### POST
1614-
<!--rehype:warp-class=row-span-2-->
1614+
<!--rehype:wrap-class=row-span-2-->
16151615
16161616
<!--rehype:-->
16171617
```javascript
@@ -1634,7 +1634,7 @@ xhr.onerror = () => {
16341634
```
16351635
16361636
### fetch api
1637-
<!--rehype:warp-class=row-span-2-->
1637+
<!--rehype:wrap-class=row-span-2-->
16381638
16391639
<!--rehype:-->
16401640
```javascript
@@ -1695,7 +1695,7 @@ fetch('https://api-xxx.com/endpoint', {
16951695
```
16961696
16971697
### async await 语法
1698-
<!--rehype:warp-class=col-span-2-->
1698+
<!--rehype:wrap-class=col-span-2-->
16991699
17001700
<!--rehype:-->
17011701
```javascript

docs/jest.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Jest 是一款优雅、简洁的 JavaScript 测试框架。
1717
- 代码覆盖, 无需其他操作,您仅需添加 --coverage 参数来生成代码覆盖率报告。
1818

1919
### 测试结构
20-
<!--rehype:warp-class=col-span-2-->
20+
<!--rehype:wrap-class=col-span-2-->
2121

2222
<!--rehype:-->
2323
```js
@@ -150,7 +150,7 @@ expect([{ a: 1 }, { b: 2 }]).toEqual([
150150
```
151151

152152
### 模拟函数
153-
<!--rehype:warp-class=row-span-2-->
153+
<!--rehype:wrap-class=row-span-2-->
154154

155155
<!--rehype:-->
156156
```js
@@ -293,7 +293,7 @@ expect(fn).toThrowErrorMatchingSnapshot()
293293
----
294294

295295
### 实例
296-
<!--rehype:warp-class=row-span-2-->
296+
<!--rehype:wrap-class=row-span-2-->
297297

298298
<!--rehype:-->
299299
请参阅 Jest 文档中的 [更多示例](https://jestjs.io/docs/en/tutorial-async)
@@ -330,7 +330,7 @@ test('async test', async () => {
330330
```
331331

332332
### done() 回调
333-
<!--rehype:warp-class=row-span-2-->
333+
<!--rehype:wrap-class=row-span-2-->
334334

335335
<!--rehype:-->
336336
```js
@@ -371,7 +371,7 @@ test('async test', () => {
371371
## 模拟
372372

373373
### 模拟函数
374-
<!--rehype:warp-class=row-span-2-->
374+
<!--rehype:wrap-class=row-span-2-->
375375

376376
<!--rehype:-->
377377
```js
@@ -409,7 +409,7 @@ const callback = jest.fn(() => true)
409409
[模拟函数文档](https://jestjs.io/docs/en/mock-function-api)
410410

411411
### 返回、解析和拒绝值
412-
<!--rehype:warp-class=row-span-2-->
412+
<!--rehype:wrap-class=row-span-2-->
413413

414414
您的模拟可以返回值:
415415

@@ -504,7 +504,7 @@ const setTitle = jest
504504
```
505505

506506
### 定时器模拟
507-
<!--rehype:warp-class=row-span-3-->
507+
<!--rehype:wrap-class=row-span-3-->
508508

509509
<!--rehype:-->
510510
为使用本机计时器函数(`setTimeout``setInterval``clearTimeout``clearInterval`)的代码编写同步测试。
@@ -556,7 +556,7 @@ Object.defineProperty(location, 'title', {
556556
```
557557

558558
### 清除和恢复模拟
559-
<!--rehype:warp-class=row-span-2-->
559+
<!--rehype:wrap-class=row-span-2-->
560560

561561
<!--rehype:-->
562562
对于一个模拟

docs/json.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ JSON 备忘清单
4747
<!--rehype:class=table-thead-hide-->
4848

4949
### 字符串
50-
<!--rehype:data-warp-style=grid-row: span 3/span 3;-->
50+
<!--rehype:data-wrap-style=grid-row: span 3/span 3;-->
5151

5252
<!--rehype:-->
5353
| | |
@@ -82,7 +82,7 @@ Have to be delimited by double quotes
8282

8383

8484
### 数字
85-
<!--rehype:warp-class=row-span-2-->
85+
<!--rehype:wrap-class=row-span-2-->
8686

8787
<!--rehype:-->
8888
| Type | Description |
@@ -229,7 +229,7 @@ let myObject = {
229229
<!--rehype:class=table-thead-hide-->
230230

231231
### 访问嵌套
232-
<!--rehype:data-warp-style=grid-row: span 2/span 2;-->
232+
<!--rehype:data-wrap-style=grid-row: span 2/span 2;-->
233233

234234
<!--rehype:-->
235235
```javascript
@@ -273,7 +273,7 @@ let myObject = {
273273
<!--rehype:class=table-thead-hide-->
274274

275275
### 访问对象数组
276-
<!--rehype:data-warp-style=grid-row: span 2/span 2;-->
276+
<!--rehype:data-wrap-style=grid-row: span 2/span 2;-->
277277

278278
<!--rehype:-->
279279
```javascript

docs/markdown.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Header 2
4242
```
4343

4444
### 无序列表
45-
<!--rehype:data-warp-style=grid-row: span 2/span 2;-->
45+
<!--rehype:data-wrap-style=grid-row: span 2/span 2;-->
4646

4747
<!--rehype:-->
4848
```markdown
@@ -166,7 +166,7 @@ console.log("This is a block code")
166166
```
167167

168168
### 表格
169-
<!--rehype:data-warp-style=grid-column: span 2/span 2;-->
169+
<!--rehype:data-wrap-style=grid-column: span 2/span 2;-->
170170

171171
<!--rehype:-->
172172
```markdown
@@ -188,7 +188,7 @@ console.log("This is a block code")
188188
Markdown 表格生成器:[tableconvert.com](https://tableconvert.com/)
189189

190190
### 图片
191-
<!--rehype:data-warp-style=grid-column: span 2/span 2;-->
191+
<!--rehype:data-wrap-style=grid-column: span 2/span 2;-->
192192

193193
<!--rehype:-->
194194
```markdown

docs/npm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ npm 备忘清单
5656

5757

5858
### 杂项功能
59-
<!--rehype:warp-class=col-span-2-->
59+
<!--rehype:wrap-class=col-span-2-->
6060

6161
将某人添加为所有者
6262

0 commit comments

Comments
 (0)