xw-devtool-cli 1.0.6 → 1.0.8
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.md +41 -5
- package/package.json +2 -1
- package/src/commands/emoji.js +114 -0
- package/src/commands/htmlEntities.js +57 -0
- package/src/commands/specialChars.js +48 -6
- package/src/index.js +11 -1
package/README.md
CHANGED
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
- **哈希计算**:支持 MD5, SHA1, SHA256, SHA512, SM3 算法。
|
|
26
26
|
- **二维码生成**:终端直接显示二维码,支持保存为 PNG 图片(带时间戳文件名)。
|
|
27
27
|
- **特殊符号大全**:包含常用符号、箭头、数学符号、货币、希腊字母等 170+ 个符号,支持一键复制。
|
|
28
|
+
- **Emoji 输入**:支持分类查看和选择常用 Emoji,一键复制到剪贴板。
|
|
29
|
+
- **HTML 实体工具**:支持 HTML 实体编码与解码 (如 `&` <-> `&`)。
|
|
28
30
|
- **便捷操作**:
|
|
29
31
|
- 支持文件选择对话框 (Windows)。
|
|
30
32
|
- 结果自动复制到剪贴板。
|
|
@@ -70,6 +72,8 @@ a. Variable Format Converter
|
|
|
70
72
|
b. Hash Calculator (MD5/SHA/SM3)
|
|
71
73
|
c. QR Code Generator
|
|
72
74
|
d. Special Characters (Symbols)
|
|
75
|
+
e. Emoji Picker
|
|
76
|
+
f. HTML Entity Encode/Decode
|
|
73
77
|
0. Exit
|
|
74
78
|
=================================
|
|
75
79
|
```
|
|
@@ -105,33 +109,65 @@ d. Special Characters (Symbols)
|
|
|
105
109
|
- 设置压缩参数(如 JPG 质量 1-100,PNG 压缩等级 0-9)。
|
|
106
110
|
- 生成的新图片将保存在源文件同级目录。
|
|
107
111
|
|
|
108
|
-
### 5.
|
|
112
|
+
### 5. 时间格式化 (Time Format)
|
|
113
|
+
- 选择 `5` 进入。
|
|
114
|
+
- 支持时间戳转日期字符串,或日期字符串转时间戳。
|
|
115
|
+
- 直接回车可获取当前时间戳。
|
|
116
|
+
|
|
117
|
+
### 6. Mock 数据生成
|
|
109
118
|
- 选择 `6` 进入。
|
|
110
119
|
- 提供多种数据类型:英文段落、中文字符、身份证号、邮箱、手机号等。
|
|
111
120
|
- 支持指定生成数量。
|
|
112
121
|
|
|
113
|
-
###
|
|
122
|
+
### 7. UUID 生成
|
|
123
|
+
- 选择 `7` 进入。
|
|
124
|
+
- 自动生成一个 UUID v4 并复制到剪贴板。
|
|
125
|
+
|
|
126
|
+
### 8. 中文转拼音
|
|
127
|
+
- 选择 `8` 进入。
|
|
128
|
+
- 输入中文字符串(支持直接回车读取剪贴板)。
|
|
129
|
+
- 输出对应的拼音(无声调)。
|
|
130
|
+
|
|
131
|
+
### 9. 颜色转换 (Hex <-> RGB)
|
|
132
|
+
- 选择 `9` 进入。
|
|
133
|
+
- 输入 Hex 颜色值 (如 #333) 或 RGB 值 (如 rgb(51,51,51))。
|
|
134
|
+
- 自动转换并显示对应格式。
|
|
135
|
+
|
|
136
|
+
### 10. 变量格式转换
|
|
114
137
|
- 选择 `a` 进入。
|
|
115
138
|
- 输入变量名(支持直接回车读取剪贴板)。
|
|
116
139
|
- 自动展示 CamelCase, PascalCase, SnakeCase, KebabCase, ConstantCase 五种格式。
|
|
117
140
|
- 选择一种格式自动复制。
|
|
118
141
|
|
|
119
|
-
###
|
|
142
|
+
### 11. 哈希计算 (Encryption)
|
|
120
143
|
- 选择 `b` 进入。
|
|
121
144
|
- 输入文本(支持直接回车读取剪贴板)。
|
|
122
145
|
- 同时计算并显示 MD5, SHA1, SHA256, SHA512, SM3 哈希值。
|
|
123
146
|
|
|
124
|
-
###
|
|
147
|
+
### 12. 二维码生成
|
|
125
148
|
- 选择 `c` 进入。
|
|
126
149
|
- 输入文本或 URL(支持直接回车读取剪贴板)。
|
|
127
150
|
- 终端直接显示二维码预览。
|
|
128
151
|
- 可选保存为 PNG 图片,默认文件名包含时间戳。
|
|
129
152
|
|
|
130
|
-
###
|
|
153
|
+
### 13. 特殊符号大全
|
|
131
154
|
- 选择 `d` 进入。
|
|
132
155
|
- 网格化展示常用特殊符号。
|
|
133
156
|
- 输入符号对应的编号即可一键复制。
|
|
134
157
|
|
|
158
|
+
### 14. Emoji 输入
|
|
159
|
+
- 选择 `e` 进入。
|
|
160
|
+
- 分类展示常用 Emoji (表情、手势、动物、食物等)。
|
|
161
|
+
- 输入编号选择并复制 Emoji 到剪贴板。
|
|
162
|
+
|
|
163
|
+
### 15. HTML 实体编码/解码
|
|
164
|
+
- 选择 `f` 进入。
|
|
165
|
+
- 支持两种编码模式:
|
|
166
|
+
- **Standard**: 仅编码特殊字符(如 `<` `>` `&` 及非 ASCII 字符)。
|
|
167
|
+
- **Everything**: 编码所有字符(包括 ASCII 字母数字)。
|
|
168
|
+
- 支持直接回车读取剪贴板内容。
|
|
169
|
+
- 结果自动复制到剪贴板。
|
|
170
|
+
|
|
135
171
|
## 📄 License
|
|
136
172
|
|
|
137
173
|
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.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "基于node的开发者助手cli",
|
|
6
6
|
"main": "index.js",
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"clipboardy": "^5.0.2",
|
|
49
49
|
"commander": "^14.0.2",
|
|
50
50
|
"dayjs": "^1.11.19",
|
|
51
|
+
"he": "^1.2.0",
|
|
51
52
|
"inquirer": "^13.1.0",
|
|
52
53
|
"lorem-ipsum": "^2.0.8",
|
|
53
54
|
"pinyin": "^4.0.0",
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
import { copy } from '../utils/clipboard.js';
|
|
3
|
+
|
|
4
|
+
const categories = {
|
|
5
|
+
'Smileys & Emotion': [
|
|
6
|
+
'😀', '😃', '😄', '😁', '😆', '😅', '😂', '🤣', '😊', '😇', '🙂', '🙃', '😉', '😌', '😍', '🥰', '😘', '😗', '😙', '😚', '😋', '😛', '😝', '😜', '🤪', '🤨', '🧐', '🤓', '😎', '🤩', '🥳', '😏', '😒', '😞', '😔', '😟', '😕', '🙁', '☹️', '😣', '😖', '😫', '😩', '🥺', '😢', '😭', '😤', '😠', '😡', '🤬', '🤯', '😳', '🥵', '🥶', '😱', '😨', '😰', '😥', '😓', '🤗', '🤔', '🤭', '🤫', '🤥', '😶', '😐', '😑', '😬', '🙄', '😯', '😦', '😧', '😮', '😲', '🥱', '😴', '🤤', '😪', '😵', '🤐', '🥴', '🤢', '🤮', '🤧', '😷', '🤒', '🤕', '🤑', '🤠', '😈', '👿', '👹', '👺', '🤡', '💩', '👻', '💀', '☠️', '👽', '👾', '🤖', '🎃', '😺', '😸', '😹', '😻', '😼', '😽', '🙀', '😿', '😾'
|
|
7
|
+
],
|
|
8
|
+
'Hand Signs': [
|
|
9
|
+
'👋', '🤚', '🖐', '✋', '🖖', '👌', '🤏', '✌️', '🤞', '🤟', '🤘', '🤙', '👈', '👉', '👆', '🖕', '👇', '☝️', '👍', '👎', '✊', '👊', '🤛', '🤜', '👏', '🙌', '👐', '🤲', '🤝', '🙏', '💅', '🤳', '💪'
|
|
10
|
+
],
|
|
11
|
+
'People & Body': [
|
|
12
|
+
'👶', '👧', '🧒', '👦', '👩', '🧑', '👨', '👵', '🧓', '👴', '👲', '👳♀️', '👳♂️', '🧕', '👮♀️', '👮♂️', '👷♀️', '👷♂️', '💂♀️', '💂♂️', '🕵️♀️', '🕵️♂️', '👩⚕️', '👨⚕️', '👩🌾', '👨🌾', '👩🍳', '👨🍳', '👩🎓', '👨🎓', '👩🎤', '👨🎤', '👩🏫', '👨🏫', '👩🏭', '👨🏭', '👩💻', '👨💻', '👩💼', '👨💼', '👩🔧', '👨🔧', '👩🔬', '👨🔬', '👩🎨', '👨🎨', '👩🚒', '👨🚒', '👩✈️', '👨✈️', '👩🚀', '👨🚀', '👩⚖️', '👨⚖️', '👰', '🤵', '👸', '🤴', '🦸♀️', '🦸♂️', '🦹♀️', '🦹♂️', '🤶', '🎅', '🧙♀️', '🧙♂️', '🧝♀️', '🧝♂️', '🧛♀️', '🧛♂️', '🧟♀️', '🧟♂️', '🧞♀️', '🧞♂️', '🧜♀️', '🧜♂️', '🧚♀️', '🧚♂️', '👼', '🤰', '🤱', '🙇♀️', '🙇♂️', '💁♀️', '💁♂️', '🙅♀️', '🙅♂️', '🙆♀️', '🙆♂️', '🙋♀️', '🙋♂️', '🤦♀️', '🤦♂️', '🤷♀️', '🤷♂️', '🙎♀️', '🙎♂️', '🙍♀️', '🙍♂️', '💇♀️', '💇♂️', '💆♀️', '💆♂️', '🧖♀️', '🧖♂️', '💃', '🕺', '👯♀️', '👯♂️', '🕴', '🚶♀️', '🚶♂️', '🏃♀️', '🏃♂️'
|
|
13
|
+
],
|
|
14
|
+
'Animals & Nature': [
|
|
15
|
+
'🐶', '🐱', '🐭', '🐹', '🐰', '🦊', '🐻', '🐼', '🐨', '🐯', '🦁', '🐮', '🐷', '🐽', '🐸', '🐵', '🙈', '🙉', '🙊', '🐒', '🐔', '🐧', '🐦', '🐤', '🐣', '🐥', '🦆', '🦅', '🦉', '🦇', '🐺', '🐗', '🐴', '🦄', '🐝', '🐛', '🦋', '🐌', '🐞', '🐜', '🦟', '🦗', '🕷', '🕸', '🦂', '🐢', '🐍', '🦎', '🦖', '🦕', '🐙', '🦑', '🦐', '🦞', '🦀', '🐡', '🐠', '🐟', '🐬', '🐳', '🐋', '🦈', '🐊', '🐅', '🐆', '🦓', '🦍', '🦧', '🐘', '🦛', '🦏', '🐪', '🐫', '🦒', '🦘', '🐃', '🐂', '🐄', '🐎', '🐖', '🐏', '🐑', '🦙', '🐐', '🦌', '🐕', '🐩', '🦮', '🐕🦺', '🐈', '🐓', '🦃', '🦚', '🦜', '🦢', '🦩', '🕊', '🐇', '🦝', '🦨', '🦡', '🦦', '🦥', '🐁', '🐀', '🐿', '🦔', '🐾', '🐉', '🐲', '🌵', '🎄', '🌲', '🌳', '🌴', '🌱', '🌿', '☘️', '🍀', '🎍', '🎋', '🍃', '🍂', '🍁', '🍄', '🐚', '🌾', '💐', '🌷', '🌹', '🥀', '🌺', '🌸', '🌼', '🌻', '🌞', '🌝', '🌛', '🌜', '🌚', '🌕', '🌖', '🌗', '🌘', '🌑', '🌒', '🌓', '🌔', '🌙', '🌎', '🌍', '🌏', '🪐', '💫', '⭐️', '🌟', '✨', '⚡️', '☄️', '💥', '🔥', '🌪', '🌈', '☀️', '🌤', '⛅️', '🌥', '☁️', '🌦', '🌧', '⛈', '🌩', '🌨', '❄️', '☃️', '⛄️', '🌬', '💨', '💧', '💦', '☔️', '☂️', '🌊', '🌫'
|
|
16
|
+
],
|
|
17
|
+
'Food & Drink': [
|
|
18
|
+
'🍏', '🍎', '🍐', '🍊', '🍋', '🍌', '🍉', '🍇', '🍓', '🍈', '🍒', '🍑', '🥭', '🍍', '🥥', '🥝', '🍅', '🍆', '🥑', '🥦', '🥬', '🥒', '🌶', '🌽', '🥕', '🧄', '🧅', '🥔', '🍠', '🥐', '🥯', '🍞', '🥖', '🥨', '🧀', '🥚', '🍳', '🧈', '🥞', '🧇', '🥓', '🥩', '🍗', '🍖', '🦴', '🌭', '🍔', '🍟', '🍕', '🥪', '🥙', '🧆', '🌮', '🌯', '🥗', '🥘', '🥫', '🍝', '🍜', '🍲', '🍛', '🍣', '🍱', '🥟', '🦪', '🍤', '🍙', '🍚', '🍘', '🍥', '🥠', '🍢', '🍡', '🍧', '🍨', '🍦', '🥧', '🧁', '🍰', '🎂', '🍮', '🍭', '🍬', '🍫', '🍿', '🍩', '🍪', '🌰', '🥜', '🍯', '🥛', '🍼', '☕️', '🍵', '🧃', '🥤', '🍶', '🍺', '🍻', '🥂', '🍷', '🥃', '🍸', '🍹', '🧉', '🍾', '🧊', '🥄', '🍴', '🍽', '🥣', '🥡', '🥢', '🧂'
|
|
19
|
+
],
|
|
20
|
+
'Activities': [
|
|
21
|
+
'⚽️', '🏀', '🏈', '⚾️', '🥎', '🎾', '🏐', '🏉', '🥏', '🎱', '🪀', '🏓', '🏸', '🏒', '🏑', '🥍', '🏏', '🥅', '⛳️', '🪁', '🏹', '🎣', '🤿', '🥊', '🥋', '🎽', '🛹', '🛷', '⛸', '🥌', '🎿', '⛷', '🏂', '🪂', '🏋️♀️', '🏋️♂️', '🤼♀️', '🤼♂️', '🤸♀️', '🤸♂️', '⛹️♀️', '⛹️♂️', '🤾♀️', '🤾♂️', '🧗♀️', '🧗♂️', '🏌️♀️', '🏌️♂️', '🧘♀️', '🧘♂️', '🧖♀️', '🧖♂️', '🏄♀️', '🏄♂️', '🏊♀️', '🏊♂️', '🤽♀️', '🤽♂️', '🚣♀️', '🚣♂️', '🏇', '🚴♀️', '🚴♂️', '🚵♀️', '🚵♂️', '🎽', '🎖', '🥇', '🥈', '🥉', '🏆', '🏵', '🎗', '🎫', '🎟', '🎪', '🤹', '🎭', '🩰', '🎨', '🎬', '🎤', '🎧', '🎼', '🎹', '🥁', '🎷', '🎺', '🎸', '🪕', '🎻', '🎲', '♟', '🎯', '🎳', '🎮', '🎰', '🧩'
|
|
22
|
+
],
|
|
23
|
+
'Travel & Places': [
|
|
24
|
+
'🚗', '🚕', '🚙', '🚌', '🚎', '🏎', '🚓', '🚑', '🚒', '🚐', '🚚', '🚛', '🚜', '🦯', '🦽', '🦼', '🛴', '🚲', '🛵', '🏍', '🛺', '🚨', '🚔', '🚍', '🚘', '🚖', '🚡', '🚠', '🚟', '🚃', '🚋', '🚞', '🚝', '🚄', '🚅', '🚈', '🚂', '🚆', '🚇', '🚊', '🚉', '✈️', '🛫', '🛬', '🛩', '💺', '🛰', '🚀', '🛸', '🚁', '🛶', '⛵️', '🚤', '🛥', '🛳', '⛴', '🚢', '⚓️', '⛽️', '🚧', '🚦', '🚥', '🚏', '🗺', '🗿', '🗽', '🗼', '🏰', '🏯', '🏟', '🎡', '🎢', '🎠', '⛲️', '⛱', '🏖', '🏝', '🏜', '🌋', '⛰', '🏔', '🗻', '🏕', '⛺️', '🏠', '🏡', '🏘', '🏚', '🏗', '🏭', '🏢', '🏬', '🏣', '🏤', '🏥', '🏦', '🏨', '🏪', '🏫', '🏩', '💒', '🏛', '⛪️', '🕌', '🕍', '🛕', '🕋', '⛩', '🛤', '🛣', '🗾', '🎑', '🏞', '🌅', '🌄', '🌠', '🎇', '🎆', '🌇', '🌆', '🏙', '🌃', '🌌', '🌉', '🌁'
|
|
25
|
+
],
|
|
26
|
+
'Objects': [
|
|
27
|
+
'⌚️', '📱', '📲', '💻', '⌨️', '🖥', '🖨', '🖱', '🖲', '🕹', '🗜', '💽', '💾', '💿', '📀', '📼', '📷', '📸', '📹', '🎥', '📽', '🎞', '📞', '☎️', '📟', '📠', '📺', '📻', '🎙', '🎚', '🎛', '🧭', '⏱', '⏲', '⏰', '🕰', '⌛️', '⏳', '📡', '🔋', '🔌', '💡', '🔦', '🕯', '🪔', '🧯', '🛢', '💸', '💵', '💴', '💶', '💷', '💰', '💳', '💎', '⚖️', '🧰', '🔧', '🔨', '⚒', '🛠', '⛏', '🪓', '🔩', '⚙️', '🧱', '⛓', '🧲', '🔫', '💣', '🧨', '🗡', '⚔️', '🛡', '🚬', '⚰️', '⚱️', '🏺', '🔮', '📿', '🧿', '💈', '⚗️', '🔭', '🔬', '🕳', '🩹', '🩺', '💊', '💉', '🩸', '🧬', '🦠', '🧫', '🧪', '🌡', '🧹', '🧺', '🧻', '🚽', '🚰', '🚿', '🛁', '🛀', '🧼', '🪒', '🧽', '🧴', '🛎', '🔑', '🗝', '🚪', '🪑', '🛋', '🛏', '🛌', '🧸', '🖼', '🛍', '🛒', '🎁', '🎈', '🎏', '🎀', '🎊', '🎉', '🎎', '🏮', '🎐', '🧧', '✉️', '📩', '📨', '📧', '💌', '📥', '📤', '📦', '🏷', '📪', '📫', '📬', '📭', '📮', '📯', '📜', '📃', '📄', '📑', '🧾', '📊', '📈', '📉', '🗒', '🗓', '📆', '📅', '🗑', '📇', '🗃', '🗳', '🗄', '📋', '📁', '📂', '🗂', '🗞', '📰', '📓', '📔', '📒', '📕', '📗', '📘', '📙', '📚', '📖', '🔖', '🧷', '🔗', '📎', '🖇', '📐', '📏', '🧮', '📌', '📍', '✂️', '🖊', '🖋', '✒️', '🖌', '🖍', '📝', '✏️', '🔍', '🔎', '🔏', '🔐', '🔒', '🔓'
|
|
28
|
+
],
|
|
29
|
+
'Symbols': [
|
|
30
|
+
'❤️', '🧡', '💛', '💚', '💙', '💜', '🖤', '🤍', '🤎', '💔', '❣️', '💕', '💞', '💓', '💗', '💖', '💘', '💝', '💟', '☮️', '✝️', '☪️', '🕉', '☸️', '✡️', '🔯', '🕎', '☯️', '☦️', '🛐', '⛎', '♈️', '♉️', '♊️', '♋️', '♌️', '♍️', '♎️', '♏️', '♐️', '♑️', '♒️', '♓️', '🆔', '⚛️', '🉑', '☢️', '☣️', '📴', '📳', '🈶', '🈚️', '🈸', '🈺', '🈷️', '✴️', '🆚', '💮', '🉐', '㊙️', '㊗️', '🈴', '🈵', '🈹', '🈲', '🅰️', '🅱️', '🆎', '🆑', '🅾️', '🆘', '❌', '⭕️', '🛑', '⛔️', '📛', '🚫', '💯', '💢', '♨️', '🚷', '🚯', '🚳', '🚱', '🔞', '📵', '🚭', '❗️', '❕', '❓', '❔', '‼️', '⁉️', '🔅', '🔆', '〽️', '⚠️', '🚸', '🔱', '⚜️', '🔰', '♻️', '✅', '🈯️', '💹', '❇️', '✳️', '❎', '🌐', '💠', 'Ⓜ️', '🌀', '💤', '🏧', '🚾', '♿️', '🅿️', '🈳', '🈂️', '🛂', '🛃', '🛄', '🛅', '🚹', '🚺', '🚼', '🚻', '🚮', '🎦', '📶', '🈁', '🔣', 'ℹ️', '🔤', '🔡', '🔠', '🆖', '🆗', '🆙', '🆒', '🆕', '🆓', '0️⃣', '1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣', '🔟', '🔢', '#️⃣', '*️⃣', '⏏️', '▶️', '⏸', '⏯', '⏹', '⏺', '⏭', '⏮', '⏩', '⏪', '⏫', '⏬', '◀️', '🔼', '🔽', '➡️', '⬅️', '⬆️', '⬇️', '↗️', '↘️', '↙️', '↖️', '↕️', '↔️', '↪️', '↩️', '⤴️', '⤵️', '🔀', '🔁', '🔂', '🔄', '🔃', '🎵', '🎶', '➕', '➖', '➗', '✖️', '♾', '💲', '💱', '™️', '©️', '®️', '👁🗨', '🔚', '🔙', '🔛', '🔝', '🔜', '〰️', '➰', '➿', '✔️', '☑️', '🔘', '🔴', '🟠', '🟡', '🟢', '🔵', '🟣', '⚫️', '⚪️', '🟤', '🔺', '🔻', '🔸', '🔹', '🔶', '🔷', '🔳', '🔲', '▪️', '▫️', '◾️', '◽️', '◼️', '◻️', '🟥', '🟧', '🟨', '🟩', '🟦', '🟪', '⬛️', '⬜️', '🟫', '🔈', '🔇', '🔉', '🔊', '🔔', '🔕', '📣', '📢', '💬', '💭', '🗯', '♠️', '♣️', '♥️', '♦️', '🃏', '🎴', '🀄️', '🕐', '🕑', '🕒', '🕓', '🕔', '🕕', '🕖', '🕗', '🕘', '🕙', '🕚', '🕛', '🕜', '🕝', '🕞', '🕟', '🕠', '🕡', '🕢', '🕣', '🕤', '🕥', '🕦', '🕧'
|
|
31
|
+
]
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export async function emojiHandler() {
|
|
35
|
+
const allEmojis = [];
|
|
36
|
+
let globalIndex = 1;
|
|
37
|
+
const colCount = 6; // Number of columns in the grid
|
|
38
|
+
|
|
39
|
+
// Prepare the list of emojis
|
|
40
|
+
Object.entries(categories).forEach(([category, symbols]) => {
|
|
41
|
+
symbols.forEach(char => {
|
|
42
|
+
allEmojis.push({
|
|
43
|
+
index: globalIndex++,
|
|
44
|
+
char: char,
|
|
45
|
+
category: category
|
|
46
|
+
});
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
while (true) {
|
|
51
|
+
console.log('\n=== Emoji Picker ===\n');
|
|
52
|
+
|
|
53
|
+
// Display emojis in a grid grouped by category
|
|
54
|
+
let currentCategory = '';
|
|
55
|
+
let rowBuffer = [];
|
|
56
|
+
|
|
57
|
+
allEmojis.forEach((item, i) => {
|
|
58
|
+
// Check if category changed
|
|
59
|
+
if (item.category !== currentCategory) {
|
|
60
|
+
// Print remaining buffer from previous category
|
|
61
|
+
if (rowBuffer.length > 0) {
|
|
62
|
+
console.log(rowBuffer.join(''));
|
|
63
|
+
rowBuffer = [];
|
|
64
|
+
}
|
|
65
|
+
currentCategory = item.category;
|
|
66
|
+
console.log(`\n--- ${currentCategory} ---`);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Add item to buffer
|
|
70
|
+
const label = `${item.index}. ${item.char}`;
|
|
71
|
+
// Emoji widths can be tricky in terminals, but we'll use a fixed padding
|
|
72
|
+
// padEnd(10) is usually enough, but some complex emojis might be wide.
|
|
73
|
+
rowBuffer.push(label.padEnd(12));
|
|
74
|
+
|
|
75
|
+
// If buffer full, print row
|
|
76
|
+
if (rowBuffer.length >= colCount) {
|
|
77
|
+
console.log(rowBuffer.join(''));
|
|
78
|
+
rowBuffer = [];
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Print remaining items
|
|
83
|
+
if (rowBuffer.length > 0) {
|
|
84
|
+
console.log(rowBuffer.join(''));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
console.log('\n0. Back to Main Menu');
|
|
88
|
+
console.log('==========================\n');
|
|
89
|
+
|
|
90
|
+
const { input } = await inquirer.prompt([
|
|
91
|
+
{
|
|
92
|
+
type: 'input',
|
|
93
|
+
name: 'input',
|
|
94
|
+
message: 'Enter the number of the emoji to copy:',
|
|
95
|
+
validate: (val) => {
|
|
96
|
+
if (val === '0') return true;
|
|
97
|
+
const num = parseInt(val);
|
|
98
|
+
if (isNaN(num) || num < 1 || num > allEmojis.length) {
|
|
99
|
+
return 'Please enter a valid number.';
|
|
100
|
+
}
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
]);
|
|
105
|
+
|
|
106
|
+
if (input === '0') {
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const selected = allEmojis[parseInt(input) - 1];
|
|
111
|
+
await copy(selected.char);
|
|
112
|
+
console.log(`\nCopied '${selected.char}' to clipboard!`);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
import he from 'he';
|
|
3
|
+
import { copy, read } from '../utils/clipboard.js';
|
|
4
|
+
import { selectFromMenu } from '../utils/menu.js';
|
|
5
|
+
|
|
6
|
+
export async function htmlEntitiesHandler() {
|
|
7
|
+
const mode = await selectFromMenu('HTML Entity Encode/Decode', [
|
|
8
|
+
{ name: 'Encode (Standard - Special chars only)', value: 'encode' },
|
|
9
|
+
{ name: 'Encode (Everything - All chars)', value: 'encodeAll' },
|
|
10
|
+
{ name: 'Decode (HTML Entities -> Text)', value: 'decode' }
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
const actionName = mode.startsWith('encode') ? 'encode' : 'decode';
|
|
14
|
+
|
|
15
|
+
const { input } = await inquirer.prompt([
|
|
16
|
+
{
|
|
17
|
+
type: 'input',
|
|
18
|
+
name: 'input',
|
|
19
|
+
message: `Enter text to ${actionName} (Press Enter to paste from clipboard):`
|
|
20
|
+
}
|
|
21
|
+
]);
|
|
22
|
+
|
|
23
|
+
let textToProcess = input;
|
|
24
|
+
|
|
25
|
+
if (!textToProcess || textToProcess.trim().length === 0) {
|
|
26
|
+
textToProcess = await read();
|
|
27
|
+
if (!textToProcess || textToProcess.trim().length === 0) {
|
|
28
|
+
console.log('Clipboard is empty or could not be read.');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
console.log(`\nUsing clipboard content: "${textToProcess.length > 50 ? textToProcess.substring(0, 47) + '...' : textToProcess}"`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let result;
|
|
35
|
+
try {
|
|
36
|
+
if (mode === 'encode') {
|
|
37
|
+
// Standard encode: only special chars like < > & " ' and non-ASCII
|
|
38
|
+
result = he.encode(textToProcess, { encodeEverything: false });
|
|
39
|
+
} else if (mode === 'encodeAll') {
|
|
40
|
+
// Encode everything: includes ASCII alphanumeric
|
|
41
|
+
result = he.encode(textToProcess, { encodeEverything: true });
|
|
42
|
+
} else {
|
|
43
|
+
result = he.decode(textToProcess);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
console.log(`\nResult:\n${result}\n`);
|
|
47
|
+
|
|
48
|
+
if (mode === 'encode' && result === textToProcess) {
|
|
49
|
+
console.log('(Note: No special characters were found to encode. Use "Encode (Everything)" if you want to encode standard letters.)\n');
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
await copy(result);
|
|
53
|
+
console.log('Result copied to clipboard!');
|
|
54
|
+
} catch (e) {
|
|
55
|
+
console.error(`Error processing HTML entities (${mode}):`, e.message);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -2,14 +2,54 @@ import inquirer from 'inquirer';
|
|
|
2
2
|
import { copy } from '../utils/clipboard.js';
|
|
3
3
|
|
|
4
4
|
const categories = {
|
|
5
|
-
'
|
|
5
|
+
'Stars': ['★', '☆', '✡', '✦', '✧', '✩', '✪', '✫', '✬', '✭', '✮', '✯', '✰'],
|
|
6
|
+
'Checks & Crosses': ['☑', '✓', '✔', '√', '☐', '☒', '☓', '✘', 'ㄨ', '✕', '✖', '✗'],
|
|
7
|
+
'Hearts': ['❤', '♡', '♥', '❥', '♠', '♣', '♤', 'ღ', '❣'],
|
|
8
|
+
'Squares & Rectangles': ['❏', '❐', '❑', '❒', '▏', '▐', '░', '▒', '▓', '▔', '▕', '■', '□', '▢', '▣', '▤', '▥', '▦', '▧', '▨', '▩', '▪', '▫', '▬', '▭', '▮', '▯', 'ˍ', '∎', '⊞', '⊟', '⊠', '⊡', '⋄', '▱', '◆', '◇', '◈', '◧', '◨', '◩', '◪', '◫', '◙', '◘', '▀', '▁', '▂', '▃', '▄', '▅', '▆', '▇', '▉', '▊', '▋', '█', '▌', '▍', '▎', '▰'],
|
|
9
|
+
'Circles': ['⊙', '●', '○', '◎', '◕', '¤', '☪', '❂', '✪', '☻', '☼', 'Θ', '⊖', '⊘', '⊕', '⊚', '⊛', '⊜', '⊝', '◉', '◌', '◍', '◐', '◑', '◒', '◓', '◔', '⊗', '◖', '◗', '◯'],
|
|
10
|
+
'Triangles': ['◤', '◥', '◄', '►', '▶', '◀', '◣', '◢', '▲', '▼', '▸', '◂', '▴', '▾', '△', '▽', '▷', '◁', '⊿', '▻', '◅', '▵', '▿', '▹', '◃', '∆', '◬', '◭', '◮', '∇', '☢'],
|
|
6
11
|
'Arrows': ['←', '↑', '→', '↓', '↔', '↕', '↖', '↗', '↘', '↙', '⇐', '⇑', '⇒', '⇓', '⇔', '⇕'],
|
|
7
12
|
'Math': ['+', '-', '×', '÷', '=', '≠', '≈', '±', '∞', '√', '∑', '∏', '∫', '∂', '∇', '∀', '∃', '∅', '∈', '∉', '⊂', '⊃', '∪', '∩', '⊥', '∠', '°', '%', '‰'],
|
|
8
|
-
'
|
|
13
|
+
'Numbers (Enclosed)': [
|
|
14
|
+
'①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳',
|
|
15
|
+
'⑴', '⑵', '⑶', '⑷', '⑸', '⑹', '⑺', '⑻', '⑼', '⑽', '⑾', '⑿', '⒀', '⒁', '⒂', '⒃', '⒄', '⒅', '⒆', '⒇',
|
|
16
|
+
'⒈', '⒉', '⒊', '⒋', '⒌', '⒍', '⒎', '⒏', '⒐', '⒑', '⒒', '⒓', '⒔', '⒕', '⒖', '⒗', '⒘', '⒙', '⒚', '⒛',
|
|
17
|
+
'㊀', '㊁', '㊂', '㊃', '㊄', '㊅', '㊆', '㊇', '㊈', '㊉',
|
|
18
|
+
'㈠', '㈡', '㈢', '㈣', '㈤', '㈥', '㈦', '㈧', '㈨', '㈩',
|
|
19
|
+
'№', '½', '⅓', '⅔', '¼', '¾', '⅛', '⅜', '⅝', '⅞'
|
|
20
|
+
],
|
|
21
|
+
'Greek Numbers': ['Ⅰ', 'Ⅱ', 'Ⅲ', 'Ⅳ', 'Ⅴ', 'Ⅵ', 'Ⅶ', 'Ⅷ', 'Ⅸ', 'Ⅹ', 'Ⅺ', 'Ⅻ', 'ⅰ', 'ⅱ', 'ⅲ', 'ⅳ', 'ⅴ', 'ⅵ', 'ⅶ', 'ⅷ', 'ⅸ', 'ⅹ', 'ⅺ', 'ⅻ'],
|
|
22
|
+
'Date & Time': [
|
|
23
|
+
'㋀', '㋁', '㋂', '㋃', '㋄', '㋅', '㋆', '㋇', '㋈', '㋉', '㋊', '㋋',
|
|
24
|
+
'㏠', '㏡', '㏢', '㏣', '㏤', '㏥', '㏦', '㏧', '㏨', '㏩', '㏪', '㏫', '㏬', '㏭', '㏮', '㏯', '㏰', '㏱', '㏲', '㏳', '㏴', '㏵', '㏶', '㏷', '㏸', '㏹', '㏺', '㏻', '㏼', '㏽', '㏾',
|
|
25
|
+
'㍘', '㍙', '㍚', '㍛', '㍜', '㍝', '㍞', '㍟', '㍠', '㍡', '㍢', '㍣', '㍤', '㍥', '㍦', '㍧', '㍨', '㍩', '㍪', '㍫', '㍬', '㍭', '㍮', '㍯', '㍰'
|
|
26
|
+
],
|
|
27
|
+
'Special Chinese': [
|
|
28
|
+
'㊐', '㊊', '㊎', '㊍', '㊌', '㊋', '㊏', '㊑', '㊒', '㊓', '㊔', '㊕', '㊖', '㊗', '㊘', '㊜', '㊝', '㊞', '㊟', '㊠', '㊡', '㊢', '㊩', '㊪', '㊫', '㊬', '㊭', '㊮', '㊯', '㊰', '㊙', '㊚', '㊛', '㊣', '㊤', '㊥', '㊦', '㊧', '㊨',
|
|
29
|
+
'囍', '㈱', '㍿', '卐', '卍', 'ォ', 'ミ', '灬', '彡', 'ツ'
|
|
30
|
+
],
|
|
31
|
+
'Music': ['♩', '♪', '♫', '♬', '¶', '♭', '♯', '♮', '∮', '‖', '§', 'Ψ'],
|
|
32
|
+
'Letters (Enclosed)': [
|
|
33
|
+
'⒜', '⒝', '⒞', '⒟', '⒠', '⒡', '⒢', '⒣', '⒤', '⒥', '⒦', '⒧', '⒨', '⒩', '⒪', '⒫', '⒬', '⒭', '⒮', '⒯', '⒰', '⒱', '⒲', '⒳', '⒴', '⒵',
|
|
34
|
+
'ⓐ', 'ⓑ', 'ⓒ', 'ⓓ', 'ⓔ', 'ⓕ', 'ⓖ', 'ⓗ', 'ⓘ', 'ⓙ', 'ⓚ', 'ⓛ', 'ⓜ', 'ⓝ', 'ⓞ', 'ⓟ', 'ⓠ', 'ⓡ', 'ⓢ', 'ⓣ', 'ⓤ', 'ⓥ', 'ⓦ', 'ⓧ', 'ⓨ', 'ⓩ',
|
|
35
|
+
'Ⓐ', 'Ⓑ', 'Ⓒ', 'Ⓓ', 'Ⓔ', 'Ⓕ', 'Ⓖ', 'Ⓗ', 'Ⓘ', 'Ⓙ', 'Ⓚ', 'Ⓛ', 'Ⓜ', 'Ⓝ', 'Ⓞ', 'Ⓟ', 'Ⓠ', 'Ⓡ', 'Ⓢ', 'Ⓣ', 'Ⓤ', 'Ⓥ', 'Ⓦ', 'Ⓧ', 'Ⓨ', 'Ⓩ'
|
|
36
|
+
],
|
|
37
|
+
'Chinese Numbers': ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖', '佰', '仟', '万', '亿'],
|
|
38
|
+
'Weather': ['☀', '☼', '♨', '☁', '☂', '☾', '☽', '❄', '❅', '❆', '☃'],
|
|
39
|
+
'Units & Gender': ['©', '®', '℃', '℉', '♂', '♀', '㎡', '℗', 'Ω', '㏎', '㎎', '㎏', '㎜', '㎝', '㎞', '㎡', '㏄', '㏎', '㏑', '㏒', '㏕', '℡', '%', '‰', '°', '′', '″', '¢', '℅'],
|
|
40
|
+
'Currency': ['¥', 'HK$', 'HKD', '$', '円', '€', '£', '₴', '₰', '¢', '₤', '₳', '₲', '₪', '₵', '₣', '₱', '฿', '¤', '₡', '₮', '₭', '₩', 'ރ', '₢', '₥', '₫', '₦', 'zł', '﷼', '₠', '₧', '₯', '₨', 'Kč', 'र', '₹', 'ƒ', '₸', '¢'],
|
|
41
|
+
'Box Drawing': [
|
|
42
|
+
'┏', '┳', '┓', '┌', '┬', '┐', '╔', '╦', '╗', '╓', '╥', '╖', '╒', '╤', '╕', '╭', '╮', '╱', '╲', '─', '│', '┱', '┲', '╃', '╄',
|
|
43
|
+
'┣', '╋', '┫', '├', '┼', '┤', '╠', '╬', '╣', '╟', '╫', '╢', '╞', '╪', '╡', '╰', '╯', '╲', '╱', '━', '┇', '┅', '┋',
|
|
44
|
+
'┗', '┻', '┛', '└', '┴', '┘', '╚', '╩', '╝', '╙', '╨', '╜', '╘', '╧', '╛', '═', '║', '︴', '﹏', '﹋', '﹌'
|
|
45
|
+
],
|
|
46
|
+
'Asterisks': ['✱', '✲', '✳', '❃', '✾', '✽', '✼', '✻', '✺', '✹', '✸', '✷', '✶', '✵', '✴', '❄', '❅', '❆', '❇', '❈', '❉', '❊', '❋'],
|
|
47
|
+
'Bagua': ['乾', '☰', '兑', '☱', '离', '☲', '震', '☳', '巽', '☴', '坎', '☵', '艮', '☶', '坤', '☷', '☯'],
|
|
48
|
+
'Punctuation': ['。', ',', '、', ':', '∶', ';', '‘', '’', '“', '”', '〝', '〞', 'ˆ', 'ˇ', '﹕', '︰', '﹔', '﹖', '﹑', '·', '¨', '.', '¸', ';', '´', '?', '!', '~', '—', '|', '‖', '"', '〃', '`', '@', '﹫', '¡', '¿', '﹏', '﹋', '︴', '々', '﹟', '#', '﹩', '$', '﹠', '&', '﹪', '%', '﹡', '﹢', '×', '﹦', '‐', ' ̄', '¯', '―', '﹨', '˜', '﹍', '﹎', '_', '-', '~', '(', ')', '〈', '〉', '‹', '›', '﹛', '﹜', '『', '』', '〖', '〗', '[', ']', '《', '》', '〔', '〕', '{', '}', '「', '」', '【', '】', '︵', '︷', '︿', '︹', '︽', '_', '︶', '︸', '﹀', '︺', '︾', 'ˉ', '﹂', '﹄', '︼', '﹁', '﹃', '︻'],
|
|
9
49
|
'Greek Letters': ['α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ', 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω', 'Δ', 'Σ', 'Ω', 'Φ', 'Ψ', 'Γ', 'Λ', 'Π', 'Θ', 'Ξ'],
|
|
10
|
-
'
|
|
11
|
-
'
|
|
12
|
-
'
|
|
50
|
+
'Pinyin': ['ā', 'á', 'ǎ', 'à', 'ō', 'ó', 'ǒ', 'ò', 'ē', 'é', 'ě', 'è', 'ī', 'í', 'ǐ', 'ì', 'ū', 'ú', 'ǔ', 'ù', 'ǖ', 'ǘ', 'ǚ', 'ǜ', 'ü', 'ê', 'ɑ', 'ń', 'ň', 'ǹ', 'ɡ', 'ㄅ', 'ㄆ', 'ㄇ', 'ㄈ', 'ㄉ', 'ㄊ', 'ㄋ', 'ㄌ', 'ㄍ', 'ㄎ', 'ㄏ', 'ㄐ', 'ㄑ', 'ㄒ', 'ㄓ', 'ㄔ', 'ㄕ', 'ㄖ', 'ㄗ', 'ㄘ', 'ㄙ', 'ㄚ', 'ㄛ', 'ㄜ', 'ㄝ', 'ㄞ', 'ㄟ', 'ㄠ', 'ㄡ', 'ㄢ', 'ㄣ', 'ㄤ', 'ㄥ', 'ㄦ', 'ㄧ', 'ㄨ', 'ㄩ'],
|
|
51
|
+
'Japanese': ['ぁ', 'あ', 'ぃ', 'い', 'ぅ', 'う', 'ぇ', 'え', 'ぉ', 'お', 'か', 'が', 'き', 'ぎ', 'く', 'ぐ', 'け', 'げ', 'こ', 'ご', 'さ', 'ざ', 'し', 'じ', 'す', 'ず', 'せ', 'ぜ', 'そ', 'ぞ', 'た', 'だ', 'ち', 'ぢ', 'っ', 'つ', 'づ', 'て', 'で', 'と', 'ど', 'な', 'に', 'ぬ', 'ね', 'の', 'は', 'ば', 'ぱ', 'ひ', 'び', 'ぴ', 'ふ', 'ぶ', 'ぷ', 'へ', 'べ', 'ぺ', 'ほ', 'ぼ', 'ぽ', 'ま', 'み', 'む', 'め', 'も', 'ゃ', 'や', 'ゅ', 'ゆ', 'ょ', 'よ', 'ら', 'り', 'る', 'れ', 'ろ', 'ゎ', 'わ', 'ゐ', 'ゑ', 'を', 'ん', 'ゔ', 'ゕ', 'ゖ', '゚', '゛', '゜', 'ゝ', 'ゞ', 'ゟ', '゠', 'ァ', 'ア', 'ィ', 'イ', 'ゥ', 'ウ', 'ェ', 'エ', 'ォ', 'オ', 'カ', 'ガ', 'キ', 'ギ', 'ク', 'グ', 'ケ', 'ゲ', 'コ', 'ゴ', 'サ', 'ザ', 'シ', 'ジ', 'ス', 'ズ', 'セ', 'ゼ', 'ソ', 'ゾ', 'タ', 'ダ', 'チ', 'ヂ', 'ッ', 'ツ', 'ヅ', 'テ', 'デ', 'ト', 'ド', 'ナ', 'ニ', 'ヌ', 'ネ', 'ノ', 'ハ', 'バ', 'パ', 'ヒ', 'ビ', 'ピ', 'フ', 'ブ', 'プ', 'ヘ', 'ベ', 'ペ', 'ホ', 'ボ', 'ポ', 'マ', 'ミ', 'ム', 'メ', 'モ', 'ャ', 'ヤ', 'ュ', 'ユ', 'ョ', 'ヨ', 'ラ', 'リ', 'ル', 'レ', 'ロ', 'ヮ', 'ワ', 'ヰ', 'ヱ', 'ヲ', 'ン', 'ヴ', 'ヵ', 'ヶ', 'ヷ', 'ヸ', 'ヹ', 'ヺ', '・', 'ー', 'ヽ', 'ヾ', 'ヿ', '㍿'],
|
|
52
|
+
'Korean': ['ㄱ', 'ㄲ', 'ㄳ', 'ㄴ', 'ㄵ', 'ㄶ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㄺ', 'lm', 'lb', 'ls', 'lt', 'lp', 'lh', 'ㅁ', 'ㅂ', 'ㅃ', 'ㅄ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ', 'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ', 'ㅏ', 'ㅐ', 'ㅑ', 'ㅒ', 'ㅓ', 'ㅔ', 'ㅕ', 'ㅖ', 'ㅗ', 'ㅘ', 'ㅙ', 'ㅚ', 'ㅛ', 'ㅜ', 'ㅝ', 'ㅞ', 'ㅟ', 'ㅠ', 'ㅡ', 'ㅢ', 'ㅥ', 'ㅦ', 'ㅧ', 'ㅨ', 'ㅩ', 'ㅪ', 'ㅫ', 'ㅬ', 'ㅭ', 'ㅮ', 'ㅯ', 'ㅰ', 'ㅱ', 'ㅲ', 'ㅳ', 'ㅴ', 'ㅵ', 'ㅶ', 'ㅷ', 'ㅸ', 'ㅹ', 'ㅺ', 'ㅻ', 'ㅼ', 'ㅽ', 'ㅾ', 'ㅿ']
|
|
13
53
|
};
|
|
14
54
|
|
|
15
55
|
export async function specialCharsHandler() {
|
|
@@ -49,8 +89,10 @@ export async function specialCharsHandler() {
|
|
|
49
89
|
|
|
50
90
|
// Add item to buffer
|
|
51
91
|
// Format: "123. X " padded
|
|
92
|
+
// Adjust padding based on symbol width?
|
|
93
|
+
// Simple padding might not align perfectly for wide chars, but it's acceptable for CLI.
|
|
52
94
|
const label = `${item.index}. ${item.char}`;
|
|
53
|
-
rowBuffer.push(label.padEnd(
|
|
95
|
+
rowBuffer.push(label.padEnd(12)); // Increased padding for wider chars
|
|
54
96
|
|
|
55
97
|
// If buffer full, print row
|
|
56
98
|
if (rowBuffer.length >= colCount) {
|
package/src/index.js
CHANGED
|
@@ -13,6 +13,8 @@ import { variableFormatHandler } from './commands/variableFormat.js';
|
|
|
13
13
|
import { hashingHandler } from './commands/hashing.js';
|
|
14
14
|
import { qrcodeHandler } from './commands/qrcode.js';
|
|
15
15
|
import { specialCharsHandler } from './commands/specialChars.js';
|
|
16
|
+
import { emojiHandler } from './commands/emoji.js';
|
|
17
|
+
import { htmlEntitiesHandler } from './commands/htmlEntities.js';
|
|
16
18
|
|
|
17
19
|
process.on('SIGINT', () => {
|
|
18
20
|
console.log('\nBye!');
|
|
@@ -42,7 +44,9 @@ const features = [
|
|
|
42
44
|
{ name: 'Variable Format Converter', value: 'variableFormat' },
|
|
43
45
|
{ name: 'Hash Calculator (MD5/SHA/SM3)', value: 'hashing' },
|
|
44
46
|
{ name: 'QR Code Generator', value: 'qrcode' },
|
|
45
|
-
{ name: 'Special Characters (Symbols)', value: 'specialChars' }
|
|
47
|
+
{ name: 'Special Characters (Symbols)', value: 'specialChars' },
|
|
48
|
+
{ name: 'Emoji Picker', value: 'emoji' },
|
|
49
|
+
{ name: 'HTML Entity Encode/Decode', value: 'htmlEntities' }
|
|
46
50
|
];
|
|
47
51
|
|
|
48
52
|
async function main() {
|
|
@@ -160,6 +164,12 @@ async function handleAction(action) {
|
|
|
160
164
|
case 'specialChars':
|
|
161
165
|
await specialCharsHandler();
|
|
162
166
|
break;
|
|
167
|
+
case 'emoji':
|
|
168
|
+
await emojiHandler();
|
|
169
|
+
break;
|
|
170
|
+
case 'htmlEntities':
|
|
171
|
+
await htmlEntitiesHandler();
|
|
172
|
+
break;
|
|
163
173
|
default:
|
|
164
174
|
console.log('Feature not implemented yet.');
|
|
165
175
|
}
|