xw-devtool-cli 1.0.17 → 1.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README_EN.md +225 -0
- package/package.json +3 -2
package/README_EN.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# xw-devtool-cli
|
|
2
|
+
|
|
3
|
+
[中文文档](./README.md) | **English**
|
|
4
|
+
|
|
5
|
+
A Node.js-based developer command-line toolbox designed to provide out-of-the-box common development tools to help developers handle daily tasks quickly.
|
|
6
|
+
|
|
7
|
+
Key features include: Base64 encoding/decoding, image format conversion, image <-> Base64, Mock data generation, timestamp/date formatting, time calculation, URL encoding/decoding, UUID generation, Chinese pinyin conversion, color conversion, variable format conversion, hash calculation, QR code generation, special symbols, Markdown snippets, VS Code snippet generation, etc. All results are automatically copied to the clipboard, greatly improving development efficiency.
|
|
8
|
+
|
|
9
|
+
## ✨ Features
|
|
10
|
+
|
|
11
|
+
- **Base64 Tools**: Convert strings to/from Base64, supports reading from clipboard, file, or manual input.
|
|
12
|
+
- **Image Tools**:
|
|
13
|
+
- **Format Conversion**: Convert between PNG, JPG, WebP, with adjustable compression quality.
|
|
14
|
+
- **Image ↔ Base64**: Convert images to Base64 strings and vice versa.
|
|
15
|
+
- **Placeholder Image**: Quickly generate placeholder images with custom size, color, and text.
|
|
16
|
+
- **Mock Data**:
|
|
17
|
+
- Generate: Lorem Ipsum, Chinese characters, ID cards, Emails, URLs, Order IDs, Phone numbers.
|
|
18
|
+
- Supports batch generation.
|
|
19
|
+
- **Time Tools**:
|
|
20
|
+
- **Formatting**: Timestamp/Date string -> `YYYY-MM-DD HH:mm:ss`.
|
|
21
|
+
- **Timestamp**: Quickly get current millisecond timestamp.
|
|
22
|
+
- **Calculation**: Calculate date differences or offsets (Add/Subtract).
|
|
23
|
+
- **Dev Tools**:
|
|
24
|
+
- **URL Encode/Decode**
|
|
25
|
+
- **Unicode Encode/Decode**: Text <-> Unicode escape sequences (\uXXXX).
|
|
26
|
+
- **UUID**: Generate UUID v4.
|
|
27
|
+
- **Pinyin**: Convert Chinese characters to Pinyin (without tone).
|
|
28
|
+
- **Color Converter**: Hex <-> RGB.
|
|
29
|
+
- **Variable Format**: CamelCase, PascalCase, SnakeCase, KebabCase, ConstantCase.
|
|
30
|
+
- **Hash Calculator**: MD5, SHA1, SHA256, SHA512, SM3.
|
|
31
|
+
- **QR Code**: Display QR codes in terminal, save as PNG.
|
|
32
|
+
- **Special Symbols**: 170+ symbols, arrows, math symbols, etc.
|
|
33
|
+
- **Emoji Picker**: Browse and copy emojis.
|
|
34
|
+
- **HTML Entity**: Encode/Decode HTML entities.
|
|
35
|
+
- **Markdown Snippets**: Common Markdown templates.
|
|
36
|
+
- **VS Code Snippets**: Generate VS Code snippet JSON from code.
|
|
37
|
+
- **Convenience**:
|
|
38
|
+
- File selection dialog (Windows).
|
|
39
|
+
- Auto-copy results to clipboard.
|
|
40
|
+
- Auto-read from clipboard.
|
|
41
|
+
- Save large results to file.
|
|
42
|
+
- **Internationalization (i18n)**:
|
|
43
|
+
- Support **English** and **Chinese**.
|
|
44
|
+
- Switch via **Settings** in the menu or use CLI flags: `xw-devtool --en` / `xw-devtool --zh`.
|
|
45
|
+
|
|
46
|
+
## 📦 Installation
|
|
47
|
+
|
|
48
|
+
### Global Installation (Recommended)
|
|
49
|
+
```bash
|
|
50
|
+
npm install -g xw-devtool-cli
|
|
51
|
+
```
|
|
52
|
+
After installation, use `xw-devtool` or `xw-dev` command.
|
|
53
|
+
|
|
54
|
+
### Run via npx
|
|
55
|
+
```bash
|
|
56
|
+
npx xw-devtool-cli@latest
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## 🚀 Quick Start
|
|
60
|
+
|
|
61
|
+
Run in terminal:
|
|
62
|
+
```bash
|
|
63
|
+
xw-devtool
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Or specify language directly:
|
|
67
|
+
```bash
|
|
68
|
+
xw-devtool --en # Start in English
|
|
69
|
+
xw-devtool --zh # Start in Chinese
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
The interactive menu will appear:
|
|
73
|
+
|
|
74
|
+
```text
|
|
75
|
+
=================================
|
|
76
|
+
xw-devtool-cli Menu
|
|
77
|
+
=================================
|
|
78
|
+
1. Image <-> Base64
|
|
79
|
+
2. Image Format Convert
|
|
80
|
+
3. Placeholder Image Generator
|
|
81
|
+
4. QR Code Generator
|
|
82
|
+
5. URL Encode/Decode
|
|
83
|
+
6. String Encode/Decode (Base64)
|
|
84
|
+
7. Unicode Encode/Decode
|
|
85
|
+
8. HTML Entity Encode/Decode
|
|
86
|
+
9. Variable Format Converter
|
|
87
|
+
a. JSON Format (Minify/Prettify)
|
|
88
|
+
b. Chinese to Pinyin
|
|
89
|
+
c. Time Format / Timestamp
|
|
90
|
+
d. Time Calculation (Diff/Offset)
|
|
91
|
+
e. Color Converter (Hex <-> RGB)
|
|
92
|
+
f. Get UUID
|
|
93
|
+
g. Hash Calculator (MD5/SHA/SM3)
|
|
94
|
+
h. Mock Text
|
|
95
|
+
i. Special Characters (Symbols)
|
|
96
|
+
j. Emoji Picker
|
|
97
|
+
k. Markdown Snippets
|
|
98
|
+
l. VS Code Snippet Generator
|
|
99
|
+
s. Settings (Language)
|
|
100
|
+
0. Exit
|
|
101
|
+
=================================
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 📖 Detailed Usage
|
|
105
|
+
|
|
106
|
+
### 1. Image <-> Base64
|
|
107
|
+
- Select `1`.
|
|
108
|
+
- **Image -> Base64**:
|
|
109
|
+
- Select image file.
|
|
110
|
+
- Output Base64 string (can save to `.txt`).
|
|
111
|
+
- **Base64 -> Image**:
|
|
112
|
+
- Input Base64 string (file or clipboard).
|
|
113
|
+
- Auto-detect format and save as file.
|
|
114
|
+
|
|
115
|
+
### 2. Image Format Convert
|
|
116
|
+
- Select `2`.
|
|
117
|
+
- Select source image.
|
|
118
|
+
- Select target format (PNG / JPG / WebP).
|
|
119
|
+
- Set quality/compression.
|
|
120
|
+
- Saved in the same directory.
|
|
121
|
+
|
|
122
|
+
### 3. Placeholder Image Generator
|
|
123
|
+
- Select `3`.
|
|
124
|
+
- **Mode 1: Local Image File**
|
|
125
|
+
- Generate file locally.
|
|
126
|
+
- Customize: Size, Colors, Text, Format.
|
|
127
|
+
- **Mode 2: Remote Image URL**
|
|
128
|
+
- Generate URL and copy to clipboard.
|
|
129
|
+
- Supports: Picsum Photos, DummyImage, Via Placeholder, Placehold.jp, DevTool Tech, FPO Img.
|
|
130
|
+
|
|
131
|
+
### 4. QR Code Generator
|
|
132
|
+
- Select `4`.
|
|
133
|
+
- Input text or URL.
|
|
134
|
+
- Preview in terminal.
|
|
135
|
+
- Option to save as PNG.
|
|
136
|
+
|
|
137
|
+
### 5. URL Encode/Decode
|
|
138
|
+
- Select `5`.
|
|
139
|
+
- Select `Encode` or `Decode`.
|
|
140
|
+
- Input URL, result auto-copied.
|
|
141
|
+
|
|
142
|
+
### 6. String Base64
|
|
143
|
+
- Select `6`.
|
|
144
|
+
- Input sources: Clipboard, File, Manual.
|
|
145
|
+
- Output: Copy, Save to file.
|
|
146
|
+
|
|
147
|
+
### 7. Unicode Encode/Decode
|
|
148
|
+
- Select `7`.
|
|
149
|
+
- **Encode**: Text to Unicode escape sequences.
|
|
150
|
+
- **Non-ASCII Only**: Recommended.
|
|
151
|
+
- **All Characters**.
|
|
152
|
+
- **Decode**: Unicode to Text.
|
|
153
|
+
|
|
154
|
+
### 8. HTML Entity Encode/Decode
|
|
155
|
+
- Select `8`.
|
|
156
|
+
- **Standard**: Special chars only.
|
|
157
|
+
- **Everything**: All chars.
|
|
158
|
+
|
|
159
|
+
### 9. Variable Format Converter
|
|
160
|
+
- Select `9`.
|
|
161
|
+
- Input variable name.
|
|
162
|
+
- Shows CamelCase, PascalCase, SnakeCase, KebabCase, ConstantCase.
|
|
163
|
+
- Select one to copy.
|
|
164
|
+
|
|
165
|
+
### 10. JSON Format
|
|
166
|
+
- Select `a`.
|
|
167
|
+
- **Minify**: Remove whitespace.
|
|
168
|
+
- **Prettify (2/4 spaces)**.
|
|
169
|
+
- **Note**: Results copied to clipboard only (to avoid flooding terminal).
|
|
170
|
+
|
|
171
|
+
### 11. Chinese to Pinyin
|
|
172
|
+
- Select `b`.
|
|
173
|
+
- Input Chinese string.
|
|
174
|
+
- Output Pinyin (no tone).
|
|
175
|
+
|
|
176
|
+
### 12. Time Format
|
|
177
|
+
- Select `c`.
|
|
178
|
+
- Timestamp <-> Date String.
|
|
179
|
+
- Enter to get current timestamp.
|
|
180
|
+
|
|
181
|
+
### 13. Time Calculation
|
|
182
|
+
- Select `d`.
|
|
183
|
+
- **Diff**: Calculate difference between two dates.
|
|
184
|
+
- **Offset**: Calculate date after add/subtract time units.
|
|
185
|
+
|
|
186
|
+
### 14. Color Converter
|
|
187
|
+
- Select `e`.
|
|
188
|
+
- Hex <-> RGB.
|
|
189
|
+
|
|
190
|
+
### 15. Get UUID
|
|
191
|
+
- Select `f`.
|
|
192
|
+
- Generate UUID v4.
|
|
193
|
+
|
|
194
|
+
### 16. Hash Calculator
|
|
195
|
+
- Select `g`.
|
|
196
|
+
- Input text.
|
|
197
|
+
- Shows MD5, SHA1, SHA256, SHA512, SM3.
|
|
198
|
+
|
|
199
|
+
### 17. Mock Data
|
|
200
|
+
- Select `h`.
|
|
201
|
+
- Generate Lorem Ipsum, Names, IDs, Emails, Phones, etc.
|
|
202
|
+
|
|
203
|
+
### 18. Special Symbols
|
|
204
|
+
- Select `i`.
|
|
205
|
+
- Grid view of symbols.
|
|
206
|
+
- Select index to copy.
|
|
207
|
+
|
|
208
|
+
### 19. Emoji Picker
|
|
209
|
+
- Select `j`.
|
|
210
|
+
- Categorized emojis.
|
|
211
|
+
- Select to copy.
|
|
212
|
+
|
|
213
|
+
### 20. Markdown Snippets
|
|
214
|
+
- Select `k`.
|
|
215
|
+
- Templates for Headers, Lists, Tables, Links, etc.
|
|
216
|
+
|
|
217
|
+
### 21. VS Code Snippet Generator
|
|
218
|
+
- Select `l`.
|
|
219
|
+
- Convert code to `.code-snippets` JSON body.
|
|
220
|
+
- Auto-escapes quotes/newlines.
|
|
221
|
+
- Copied to clipboard.
|
|
222
|
+
|
|
223
|
+
## 📄 License
|
|
224
|
+
|
|
225
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "xw-devtool-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "基于node的开发者助手cli",
|
|
6
6
|
"main": "index.js",
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
"bin",
|
|
13
13
|
"src",
|
|
14
|
-
"README.md"
|
|
14
|
+
"README.md",
|
|
15
|
+
"README_EN.md"
|
|
15
16
|
],
|
|
16
17
|
"scripts": {
|
|
17
18
|
"start": "node bin/index.js",
|