xw-devtool-cli 1.0.19 → 1.0.20

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.
Files changed (2) hide show
  1. package/README.md +251 -27
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # xw-devtool-cli
2
2
 
3
- **中文** | [English Documentation](https://unpkg.com/xw-devtool-cli@latest/README_EN.md)
3
+ **中文** | [English](#english)
4
4
 
5
5
  一个基于 Node.js 的开发者命令行工具箱,旨在提供开箱即用的常用开发工具,帮助开发者快速处理日常任务。
6
6
 
@@ -74,31 +74,31 @@ xw-devtool --en # 英文启动 (Start in English)
74
74
 
75
75
  ```text
76
76
  =================================
77
- xw-devtool-cli Menu
77
+ xw-devtool-cli 菜单
78
78
  =================================
79
- 1. Image <-> Base64
80
- 2. Image Format Convert
81
- 3. Placeholder Image Generator
82
- 4. QR Code Generator
83
- 5. URL Encode/Decode
84
- 6. String Encode/Decode (Base64)
85
- 7. Unicode Encode/Decode
86
- 8. HTML Entity Encode/Decode
87
- 9. Variable Format Converter
88
- a. JSON Format (Minify/Prettify)
89
- b. Chinese to Pinyin
90
- c. Time Format / Timestamp
91
- d. Time Calculation (Diff/Offset)
92
- e. Color Converter (Hex <-> RGB)
93
- f. Get UUID
94
- g. Hash Calculator (MD5/SHA/SM3)
95
- h. Mock Text
96
- i. Special Characters (Symbols)
97
- j. Emoji Picker
98
- k. Markdown Snippets
99
- l. VS Code Snippet Generator
100
- s. Settings (Language)
101
- 0. Exit
79
+ 1. 图片 Base64
80
+ 2. 图片格式转换
81
+ 3. 占位图生成
82
+ 4. 二维码生成
83
+ 5. URL 编解码
84
+ 6. 字符串 Base64 转换
85
+ 7. Unicode 编解码
86
+ 8. HTML 实体 编码/解码
87
+ 9. 变量格式转换
88
+ a. JSON 格式 (压缩/美化)
89
+ b. 中文转拼音
90
+ c. 时间格式 / 时间戳
91
+ d. 时间计算 (差值/偏移)
92
+ e. 颜色转换 (Hex RGB)
93
+ f. 获取 UUID
94
+ g. 哈希计算 (MD5/SHA/SM3)
95
+ h. Mock 文本
96
+ i. 特殊符号大全
97
+ j. Emoji 输入
98
+ k. Markdown 语法工具
99
+ l. VS Code 代码段生成器
100
+ s. 设置 (语言)
101
+ 0. 退出
102
102
  =================================
103
103
  ```
104
104
 
@@ -269,6 +269,230 @@ s. Settings (Language)
269
269
  - **注意**:为防止长文本刷屏,结果**仅自动复制到剪贴板**,不会在终端打印。
270
270
  - **提示**:生成的代码段会自动包含语法速查表 (Syntax Cheatsheet) 作为注释,方便参考。
271
271
 
272
- ## 📄 License
272
+ ## 📄 License
273
+
274
+ ISC
275
+
276
+ ---
277
+
278
+ ## English
279
+
280
+ **English** | [中文](#xw-devtool-cli)
281
+
282
+ 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.
283
+
284
+ 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.
285
+
286
+ ### ✨ Features
287
+
288
+ - **Base64 Tools**: Convert strings to/from Base64, supports reading from clipboard, file, or manual input.
289
+ - **Image Tools**:
290
+ - **Format Conversion**: Convert between PNG, JPG, WebP, with adjustable compression quality.
291
+ - **Image ↔ Base64**: Convert images to Base64 strings and vice versa.
292
+ - **Placeholder Image**: Quickly generate placeholder images with custom size, color, and text.
293
+ - **Mock Data**:
294
+ - Generate: Lorem Ipsum, Chinese characters, ID cards, Emails, URLs, Order IDs, Phone numbers.
295
+ - Supports batch generation.
296
+ - **Time Tools**:
297
+ - **Formatting**: Timestamp/Date string -> `YYYY-MM-DD HH:mm:ss`.
298
+ - **Timestamp**: Quickly get current millisecond timestamp.
299
+ - **Calculation**: Calculate date differences or offsets (Add/Subtract).
300
+ - **Dev Tools**:
301
+ - **URL Encode/Decode**
302
+ - **Unicode Encode/Decode**: Text <-> Unicode escape sequences (\uXXXX).
303
+ - **UUID**: Generate UUID v4.
304
+ - **Pinyin**: Convert Chinese characters to Pinyin (without tone).
305
+ - **Color Converter**: Hex <-> RGB.
306
+ - **Variable Format**: CamelCase, PascalCase, SnakeCase, KebabCase, ConstantCase.
307
+ - **Hash Calculator**: MD5, SHA1, SHA256, SHA512, SM3.
308
+ - **QR Code**: Display QR codes in terminal, save as PNG.
309
+ - **Special Symbols**: 170+ symbols, arrows, math symbols, etc.
310
+ - **Emoji Picker**: Browse and copy emojis.
311
+ - **HTML Entity**: Encode/Decode HTML entities.
312
+ - **Markdown Snippets**: Common Markdown templates.
313
+ - **VS Code Snippets**: Generate VS Code snippet JSON from code.
314
+ - **Convenience**:
315
+ - File selection dialog (Windows).
316
+ - Auto-copy results to clipboard.
317
+ - Auto-read from clipboard.
318
+ - Save large results to file.
319
+ - **Internationalization (i18n)**:
320
+ - Support **English** and **Chinese**.
321
+ - Switch via **Settings** in the menu or use CLI flags: `xw-devtool --en` / `xw-devtool --zh`.
322
+
323
+ ### 📦 Installation
324
+
325
+ #### Global Installation (Recommended)
326
+ ```bash
327
+ npm install -g xw-devtool-cli
328
+ ```
329
+ After installation, use `xw-devtool` or `xw-dev` command.
330
+
331
+ #### Run via npx
332
+ ```bash
333
+ npx xw-devtool-cli@latest
334
+ ```
273
335
 
274
- ISC
336
+ ### 🚀 Quick Start
337
+
338
+ Run in terminal:
339
+ ```bash
340
+ xw-devtool
341
+ ```
342
+
343
+ Or specify language directly:
344
+ ```bash
345
+ xw-devtool --en # Start in English
346
+ xw-devtool --zh # Start in Chinese
347
+ ```
348
+
349
+ The interactive menu will appear:
350
+
351
+ ```text
352
+ =================================
353
+ xw-devtool-cli Menu
354
+ =================================
355
+ 1. Image <-> Base64
356
+ 2. Image Format Convert
357
+ 3. Placeholder Image Generator
358
+ 4. QR Code Generator
359
+ 5. URL Encode/Decode
360
+ 6. String Encode/Decode (Base64)
361
+ 7. Unicode Encode/Decode
362
+ 8. HTML Entity Encode/Decode
363
+ 9. Variable Format Converter
364
+ a. JSON Format (Minify/Prettify)
365
+ b. Chinese to Pinyin
366
+ c. Time Format / Timestamp
367
+ d. Time Calculation (Diff/Offset)
368
+ e. Color Converter (Hex <-> RGB)
369
+ f. Get UUID
370
+ g. Hash Calculator (MD5/SHA/SM3)
371
+ h. Mock Text
372
+ i. Special Characters (Symbols)
373
+ j. Emoji Picker
374
+ k. Markdown Snippets
375
+ l. VS Code Snippet Generator
376
+ s. Settings (Language)
377
+ 0. Exit
378
+ =================================
379
+ ```
380
+
381
+ ### 📖 Detailed Usage
382
+
383
+ #### 1. Image <-> Base64
384
+ - Select `1`.
385
+ - **Image -> Base64**:
386
+ - Select image file.
387
+ - Output Base64 string (can save to `.txt`).
388
+ - **Base64 -> Image**:
389
+ - Input Base64 string (file or clipboard).
390
+ - Auto-detect format and save as file.
391
+
392
+ #### 2. Image Format Convert
393
+ - Select `2`.
394
+ - Select source image.
395
+ - Select target format (PNG / JPG / WebP).
396
+ - Set quality/compression.
397
+ - Saved in the same directory.
398
+
399
+ #### 3. Placeholder Image Generator
400
+ - Select `3`.
401
+ - **Mode 1: Local Image File**
402
+ - Generate file locally.
403
+ - Customize: Size, Colors, Text, Format.
404
+ - **Mode 2: Remote Image URL**
405
+ - Generate URL and copy to clipboard.
406
+ - Supports: Picsum Photos, DummyImage, Via Placeholder, Placehold.jp, DevTool Tech, FPO Img.
407
+
408
+ #### 4. QR Code Generator
409
+ - Select `4`.
410
+ - Input text or URL.
411
+ - Preview in terminal.
412
+ - Option to save as PNG.
413
+
414
+ #### 5. URL Encode/Decode
415
+ - Select `5`.
416
+ - Select `Encode` or `Decode`.
417
+ - Input URL, result auto-copied.
418
+
419
+ #### 6. String Base64
420
+ - Select `6`.
421
+ - Input sources: Clipboard, File, Manual.
422
+ - Output: Copy, Save to file.
423
+
424
+ #### 7. Unicode Encode/Decode
425
+ - Select `7`.
426
+ - **Encode**: Text to Unicode escape sequences.
427
+ - **Non-ASCII Only**: Recommended.
428
+ - **All Characters**.
429
+ - **Decode**: Unicode to Text.
430
+
431
+ #### 8. HTML Entity Encode/Decode
432
+ - Select `8`.
433
+ - **Standard**: Special chars only.
434
+ - **Everything**: All chars.
435
+
436
+ #### 9. Variable Format Converter
437
+ - Select `9`.
438
+ - Input variable name.
439
+ - Shows CamelCase, PascalCase, SnakeCase, KebabCase, ConstantCase.
440
+ - Select one to copy.
441
+
442
+ #### 10. JSON Format
443
+ - Select `a`.
444
+ - **Minify**: Remove whitespace.
445
+ - **Prettify (2/4 spaces)**.
446
+ - **Note**: Results copied to clipboard only (to avoid flooding terminal).
447
+
448
+ #### 11. Chinese to Pinyin
449
+ - Select `b`.
450
+ - Input Chinese string.
451
+ - Output Pinyin (no tone).
452
+
453
+ #### 12. Time Format
454
+ - Select `c`.
455
+ - Timestamp <-> Date String.
456
+ - Enter to get current timestamp.
457
+
458
+ #### 13. Time Calculation
459
+ - Select `d`.
460
+ - **Diff**: Calculate difference between two dates.
461
+ - **Offset**: Calculate date after add/subtract time units.
462
+
463
+ #### 14. Color Converter
464
+ - Select `e`.
465
+ - Hex <-> RGB.
466
+
467
+ #### 15. Get UUID
468
+ - Select `f`.
469
+ - Generate UUID v4.
470
+
471
+ #### 16. Hash Calculator
472
+ - Select `g`.
473
+ - Input text.
474
+ - Shows MD5, SHA1, SHA256, SHA512, SM3.
475
+
476
+ #### 17. Mock Data
477
+ - Select `h`.
478
+ - Generate Lorem Ipsum, Names, IDs, Emails, Phones, etc.
479
+
480
+ #### 18. Special Symbols
481
+ - Select `i`.
482
+ - Grid view of symbols.
483
+ - Select index to copy.
484
+
485
+ #### 19. Emoji Picker
486
+ - Select `j`.
487
+ - Categorized emojis.
488
+ - Select to copy.
489
+
490
+ #### 20. Markdown Snippets
491
+ - Select `k`.
492
+ - Templates for Headers, Lists, Tables, Links, etc.
493
+
494
+ #### 21. VS Code Snippet Generator
495
+ - Select `l`.
496
+ - Convert code to `.code-snippets` JSON body.
497
+ - Auto-escapes quotes/newlines.
498
+ - Copied to clipboard.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xw-devtool-cli",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "type": "module",
5
5
  "description": "基于node的开发者助手cli",
6
6
  "main": "index.js",