Skip to content

Commit 5dfe746

Browse files
committed
chore: add readme info to use and update package json
1 parent 2782747 commit 5dfe746

File tree

2 files changed

+89
-3
lines changed

2 files changed

+89
-3
lines changed

README.md

+86
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,88 @@
11
# LeetcodePracticeTemplate
22
A template project to use leetcode-practice......
3+
4+
## Usage
5+
6+
### 1. first step - install dependency
7+
8+
The only one dependency is `leetcode-practice`.
9+
10+
```shell
11+
# run npm i
12+
npm i
13+
# or run yarn
14+
yarn
15+
```
16+
### 2. second step - use npm run to run
17+
18+
And then, you only need to run the command `npm run lc` to create the question today.
19+
20+
```shell
21+
# run lc to create
22+
npm run lc
23+
```
24+
25+
and you can see the console, and the question be created at the directory `src`.
26+
27+
```shell
28+
yarn run v1.22.19
29+
$ lc -d src
30+
MODE: today
31+
题目[2235.将标题首字母大写]获取成功!
32+
题目文件地址为:file:///Users/mac-106/wh131462/workspace/LeetcodePracticeTemplate/src/2235.capitalize-the-title/question.js:35
33+
✨ Done in 2.96s.
34+
```
35+
36+
### 3. third step - check your resolution
37+
38+
Just run the command `npm run lk`.
39+
40+
```shell
41+
# run lk to check
42+
npm run lk
43+
```
44+
45+
and you can see(the example is empty code):
46+
47+
```shell
48+
yarn run v1.22.19
49+
$ lk -d src
50+
MODE: today
51+
题目[2235.将标题首字母大写]检测结果:
52+
┌────────────┬──────────────────────────────────────────┬──────────────────────────────────────────┬────────────┬────────────┐
53+
│ 测试结果 │ 预期结果 │ 执行结果 │ 执行用时 │ 内存占用 │
54+
├────────────┼──────────────────────────────────────────┼──────────────────────────────────────────┼────────────┼────────────┤
55+
│ 未通过 │ "Capitalize The Title" │ │ 0.5894ms │ 2.42 KB │
56+
│ 未通过 │ "First Letter of Each Word" │ │ 0.0182ms │ 2.56 KB │
57+
│ 未通过 │ "i Love Leetcode" │ │ 0.0087ms │ 2.56 KB │
58+
└────────────┴──────────────────────────────────────────┴──────────────────────────────────────────┴────────────┴────────────┘
59+
点击跳转到题目提交: https://leetcode.cn/problems/capitalize-the-title/
60+
✨ Done in 0.36s.
61+
```
62+
63+
### 4. forth step - if you want to search
64+
65+
If you want to search one question , you can use the `lf`.
66+
67+
```shell
68+
# run lf to search
69+
npm run lf
70+
```
71+
and then follow the hints to search what you want.
72+
```shell
73+
# such as I want to find the question two number of sum
74+
yarn run v1.22.19
75+
$ lf -d src
76+
? 请选择查找的模式? 关键词搜索
77+
? 请输入关键词 two number sum
78+
? 请选择题目 1.两数之和
79+
1
80+
MODE: identity
81+
题目[1.两数之和]获取成功!
82+
题目文件地址为:file:///Users/mac-106/wh131462/workspace/LeetcodePracticeTemplate/src/1.two-sum/question.js:30
83+
✨ Done in 13.68s.
84+
```
85+
86+
## More...
87+
88+
If you want to know more about the leetcode-practice. Please check the github : [leetcode-practice](https://github.com/EternalHeartTeam/leetcode-practice)

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"scripts": {
66
"lc": "lc -d src",
77
"lk": "lk -d src",
8-
"lf": "lk -d src",
9-
"update": "npm install leetcode-practice@latest"
8+
"lf": "lf -d src",
9+
"update": "npm install --dev leetcode-practice@latest"
1010
},
1111
"keywords": [
1212
"leetcode-practice",
@@ -17,6 +17,6 @@
1717
"author": "EternalHeart",
1818
"license": "ISC",
1919
"devDependencies": {
20-
"leetcode-practice": "^1.0.4"
20+
"leetcode-practice": "^1.0.5"
2121
}
2222
}

0 commit comments

Comments
 (0)