piclist 2.0.1 → 2.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## (2025-08-21)
2
+
3
+ * :pencil: Docs(custom): update readme be7edd1
4
+ * :sparkles: Feature(custom): support set image process setting for per picbed a98185b
5
+ * :zap: Perf(custom): optimize random string generation algorithm c386b48
6
+
7
+
8
+
1
9
  ## (2025-08-20)
2
10
 
3
11
  * :bug: Fix(custom): replace mime-type with mime 18e6b75
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PicList-Core
2
2
 
3
- English | [简体中文](./README_cn.md)
3
+ [English](./README_en.md) | [简体中文](./README.md)
4
4
 
5
5
  ![standard](https://img.shields.io/badge/code%20style-standard-green.svg?style=flat-square)
6
6
  ![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)
@@ -8,40 +8,40 @@ English | [简体中文](./README_cn.md)
8
8
 
9
9
  ![picgo-core](https://cdn.jsdelivr.net/gh/Molunerfinn/test/picgo/picgo-core-fix.jpg)
10
10
 
11
- A powerful tool for image uploading with both CLI & API support. PicList-Core extends PicGo-Core with additional features while maintaining plugin compatibility. Check out [Awesome-PicGo](https://github.com/PicGo/Awesome-PicGo) for a collection of powerful plugins.
11
+ PicList-Core 是一个功能强大的图片上传工具,提供 CLI API 两种调用方式。它在 PicGo-Core 的基础上增强了功能,同时保持插件兼容性。查看 [Awesome-PicGo](https://github.com/PicGo/Awesome-PicGo) 获取丰富的插件资源。
12
12
 
13
- You can refer to the [DeepWiki of PiclList-Core](https://deepwiki.com/Kuingsmile/PicList-Core/) for more information.
13
+ 你可以查看 [PiclList-Core 的 DeepWiki](https://deepwiki.com/Kuingsmile/PicList-Core/) 获取更多信息。
14
14
 
15
- **Natively supports Typora integration**.
15
+ **原生支持 Typora 集成**。
16
16
 
17
- ## Enhanced Features
17
+ ## 增强功能
18
18
 
19
- - **Image processing capabilities**:
20
- - Add watermarks, compress images, and convert formats
21
- - Configure via `picgo set buildin watermark` and `picgo set buildin compress` CLI commands
22
- - Processing happens during beforeTransform phase, ensuring compatibility with all plugins
19
+ - **图像处理能力**:
20
+ - 添加水印、压缩图片和转换格式
21
+ - 通过 `picgo set buildin watermark` `picgo set buildin compress` CLI 命令进行配置
22
+ - 处理过程发生在 beforeTransform 阶段,确保与所有插件兼容
23
23
 
24
- - **Advanced renaming**:
25
- - Set custom rename rules via `picgo set buildin rename`
24
+ - **高级重命名**:
25
+ - 通过 `picgo set buildin rename` 设置自定义重命名规则
26
26
 
27
- - **Additional built-in image hosting services**:
28
- - WebDAV, SFTP, Local path, AWS S3
29
- - Improved Imgur support with account-based uploads
27
+ - **额外内置图床**:
28
+ - WebDAVSFTP、本地路径、AWS S3
29
+ - 改进的 Imgur 支持,支持账户上传
30
30
 
31
- - **Built-in server**:
32
- - Similar to PicList-Desktop server
33
- - Launch with `picgo-server` command
31
+ - **内置服务器**:
32
+ - 类似于 PicList-Desktop 服务器
33
+ - 使用 `picgo-server` 命令启动
34
34
 
35
- - **Bug fixes**:
36
- - Addresses several issues from the original PicGo-Core
35
+ - **错误修复**:
36
+ - 解决了原始 PicGo-Core 的多个问题
37
37
 
38
- ## Installation
38
+ ## 安装
39
39
 
40
- PicList requires Node.js >= 20
40
+ PicList 需要 Node.js >= 20
41
41
 
42
- ### Prerequisites
42
+ ### 前置条件
43
43
 
44
- PicList depends on [sharp](https://sharp.pixelplumbing.com/). Install it first:
44
+ PicList 依赖 [sharp](https://sharp.pixelplumbing.com/),请先安装它:
45
45
 
46
46
  ```bash
47
47
  npm config set sharp_binary_host "https://npmmirror.com/mirrors/sharp"
@@ -49,35 +49,35 @@ npm config set sharp_libvips_binary_host "https://npmmirror.com/mirrors/sharp-li
49
49
  npm install sharp
50
50
  ```
51
51
 
52
- ### Global install
52
+ ### 全局安装
53
53
 
54
54
  ```bash
55
55
  npm install piclist -g
56
56
 
57
- # or
57
+ # 或者
58
58
 
59
59
  yarn global add piclist
60
60
  ```
61
61
 
62
- ### Local install
62
+ ### 本地安装
63
63
 
64
64
  ```bash
65
65
  npm install piclist -D
66
66
 
67
- # or
67
+ # 或者
68
68
 
69
69
  yarn add piclist -D
70
70
  ```
71
71
 
72
- ## Usage
72
+ ## 使用方法
73
73
 
74
74
  ### Docker
75
75
 
76
- You can use docker to run PicList-Core.
76
+ 你可以使用Docker运行PicList-Core
77
77
 
78
78
  #### docker run
79
79
 
80
- Change the `./piclist` to your own path, this path is where you put your `config.json` file, and change the `piclist123456` to your own secret key.
80
+ 将`./piclist`更改为你自己的路径,该路径是放置`config.json`文件的位置,并将`piclist123456`更改为你自己的密钥。
81
81
 
82
82
  ```bash
83
83
  docker run -d \
@@ -91,7 +91,7 @@ docker run -d \
91
91
 
92
92
  #### docker-compose
93
93
 
94
- download `docker-compose.yml` from this repo, or copy the following content to `docker-compose.yml`:
94
+ 从本仓库下载`docker-compose.yml`,或将以下内容复制到`docker-compose.yml`:
95
95
 
96
96
  ```yaml
97
97
  version: '3.3'
@@ -108,46 +108,46 @@ services:
108
108
  command: node /usr/local/bin/picgo-server -k piclist123456
109
109
  ```
110
110
 
111
- You can change the `./piclist` to your own path, this path is where you put your `config.json` file, and change the `command` to your own secret key.
111
+ 你可以将`./piclist`更改为你自己的路径,该路径是放置`config.json`文件的位置,并在`command`中更改密钥。
112
112
 
113
- Then run:
113
+ 然后运行:
114
114
 
115
115
  ```bash
116
116
  docker-compose up -d
117
117
  ```
118
118
 
119
- #### Install plugins in docker
119
+ #### 在Docker中安装插件
120
120
 
121
- You can use `docker exec` to install plugins in docker.
121
+ 你可以使用`docker exec`在Docker中安装插件。
122
122
 
123
123
  ```bash
124
124
  docker exec -it piclist sh
125
125
  picgo install picgo-plugin-xxx
126
126
  ```
127
127
 
128
- #### Change config in docker
128
+ #### 在Docker中更新配置
129
129
 
130
- You can use `docker exec` to change config in docker.
130
+ 你可以使用`docker exec`在Docker中更新配置。
131
131
 
132
132
  ```bash
133
133
  docker exec -it piclist sh
134
134
  picgo set xxx
135
135
  ```
136
136
 
137
- ### Server
137
+ ### 服务器
138
138
 
139
- You can use `picgo-server` to start a server, default port is `36677`.
139
+ 你可以使用`picgo-server`启动服务器,默认端口为`36677`。
140
140
 
141
- Start server:
141
+ 启动服务器:
142
142
 
143
143
  ```bash
144
144
  picgo-server
145
145
  node ./bin/picgo-server
146
146
  ```
147
147
 
148
- > It's highly recommended to add `--key` to avoid unauthorized access. Example: `picgo-server --key 123456`,
148
+ > 强烈建议添加`--key`参数以避免未经授权的访问。例如:`picgo-server --key 123456`
149
149
 
150
- Show help:
150
+ 显示帮助:
151
151
 
152
152
  ```bash
153
153
  $ picgo-server -h
@@ -156,12 +156,12 @@ $ picgo-server -h
156
156
 
157
157
  Options:
158
158
 
159
- -h, --help Print this help message
160
- -c, --config Set config path
161
- -p, --port Set port, default port is 36677
162
- --host Set host, default host is 0.0.0.0
163
- -k, --key Set secret key to avoid unauthorized access
164
- -v, --version Print version number
159
+ -h, --help 显示帮助信息
160
+ -c, --config 设置配置路径
161
+ -p, --port 设置端口,默认端口为36677
162
+ --host 设置主机,默认主机为0.0.0.0
163
+ -k, --key 设置密钥以避免未经授权的访问
164
+ -v, --version 显示版本号
165
165
 
166
166
  Examples:
167
167
  picgo-server -c /path/to/config.json
@@ -169,16 +169,16 @@ $ picgo-server -h
169
169
  picgo-server -c /path/to/config.json -k 123456
170
170
  ```
171
171
 
172
- #### endpoints
172
+ #### 接口
173
173
 
174
- - `/upload?picbed=xxx&key=xxx` upload picture, `picbed` to set pic-bed, `key` to set secret key
175
- - `/heartbeat` heartbeat
174
+ - `/upload?picbed=xxx&key=xxx` 上传图片,`picbed`用于设置图床,`key`用于设置密钥
175
+ - `/heartbeat` 心跳检测
176
176
 
177
- ### Use in CLI
177
+ ### CLI使用
178
178
 
179
- > PicList-Core uses `SM.MS` as the default upload pic-bed.
179
+ > PicList-Core使用`SM.MS`作为默认上传图床。
180
180
 
181
- Show help:
181
+ 显示帮助:
182
182
 
183
183
  ```bash
184
184
  $ picgo -h
@@ -187,63 +187,63 @@ $ picgo -h
187
187
 
188
188
  Options:
189
189
 
190
- -v, --version output the version number
191
- -d, --debug debug mode
192
- -s, --silent silent mode
193
- -c, --config <path> set config path
194
- -h, --help output usage information
190
+ -v, --version 输出版本号
191
+ -d, --debug 调试模式
192
+ -s, --silent 静默模式
193
+ -c, --config <path> 设置配置路径
194
+ -h, --help 输出使用信息
195
195
 
196
196
  Commands:
197
197
 
198
- install|add <plugins...> install picgo plugin
199
- uninstall|rm <plugins...> uninstall picgo plugin
200
- update <plugins...> update picgo plugin
201
- set|config <module> [name] configure config of picgo modules
202
- upload|u [input...] upload, go go go
203
- use [module] use modules of picgo
204
- init [options] <template> [project] create picgo plugin\'s development templates
198
+ install|add <plugins...> 安装picgo插件
199
+ uninstall|rm <plugins...> 卸载picgo插件
200
+ update <plugins...> 更新picgo插件
201
+ set|config <module> [name] 配置picgo模块
202
+ upload|u [input...] 上传,开始上传
203
+ use [module] 使用picgo模块
204
+ init [options] <template> [project] 创建picgo插件的开发模板
205
205
  ```
206
206
 
207
- #### Upload a picture from path
207
+ #### 从路径上传图片
208
208
 
209
209
  ```bash
210
210
  picgo upload /xxx/xx/xx.jpg
211
211
  ```
212
212
 
213
- #### Upload a picture from clipboard
213
+ #### 从剪贴板上传图片
214
214
 
215
- > picture from clipboard will be converted to `png`
215
+ > 从剪贴板获取的图片将被转换为`png`格式
216
216
 
217
217
  ```bash
218
218
  picgo upload
219
219
  ```
220
220
 
221
- ### Use in node project
221
+ ### 在Node项目中使用
222
222
 
223
- #### Common JS
223
+ #### CommonJS
224
224
 
225
225
  ```js
226
226
  const { PicGo } = require('piclist')
227
227
  ```
228
228
 
229
- #### ES Module
229
+ #### ES模块
230
230
 
231
231
  ```js
232
232
  import { PicGo } from 'piclist'
233
233
  ```
234
234
 
235
- #### API usage example
235
+ #### API使用示例
236
236
 
237
237
  ```js
238
238
  const picgo = new PicGo()
239
239
 
240
- // upload a picture from path
240
+ // 从路径上传图片
241
241
  picgo.upload(['/xxx/xxx.jpg'])
242
242
 
243
- // upload a picture from clipboard
243
+ // 从剪贴板上传图片
244
244
  picgo.upload()
245
245
  ```
246
246
 
247
- ## Documentation
247
+ ## 文档
248
248
 
249
- For more details, you can checkout [documentation of PicGo-Core](https://picgo.github.io/PicGo-Core-Doc/).
249
+ 获取更多详细信息,请查看[PicGo-Core文档](https://picgo.github.io/PicGo-Core-Doc/)
package/README_en.md ADDED
@@ -0,0 +1,249 @@
1
+ # PicList-Core
2
+
3
+ [English](./README_en.md) | [简体中文](./README.md)
4
+
5
+ ![standard](https://img.shields.io/badge/code%20style-standard-green.svg?style=flat-square)
6
+ ![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)
7
+ ![node](https://img.shields.io/badge/node-%3E%3D16.0.0-blue?style=flat-square)
8
+
9
+ ![picgo-core](https://cdn.jsdelivr.net/gh/Molunerfinn/test/picgo/picgo-core-fix.jpg)
10
+
11
+ A powerful tool for image uploading with both CLI & API support. PicList-Core extends PicGo-Core with additional features while maintaining plugin compatibility. Check out [Awesome-PicGo](https://github.com/PicGo/Awesome-PicGo) for a collection of powerful plugins.
12
+
13
+ You can refer to the [DeepWiki of PiclList-Core](https://deepwiki.com/Kuingsmile/PicList-Core/) for more information.
14
+
15
+ **Natively supports Typora integration**.
16
+
17
+ ## Enhanced Features
18
+
19
+ - **Image processing capabilities**:
20
+ - Add watermarks, compress images, and convert formats
21
+ - Configure via `picgo set buildin watermark` and `picgo set buildin compress` CLI commands
22
+ - Processing happens during beforeTransform phase, ensuring compatibility with all plugins
23
+
24
+ - **Advanced renaming**:
25
+ - Set custom rename rules via `picgo set buildin rename`
26
+
27
+ - **Additional built-in image hosting services**:
28
+ - WebDAV, SFTP, Local path, AWS S3
29
+ - Improved Imgur support with account-based uploads
30
+
31
+ - **Built-in server**:
32
+ - Similar to PicList-Desktop server
33
+ - Launch with `picgo-server` command
34
+
35
+ - **Bug fixes**:
36
+ - Addresses several issues from the original PicGo-Core
37
+
38
+ ## Installation
39
+
40
+ PicList requires Node.js >= 20
41
+
42
+ ### Prerequisites
43
+
44
+ PicList depends on [sharp](https://sharp.pixelplumbing.com/). Install it first:
45
+
46
+ ```bash
47
+ npm config set sharp_binary_host "https://npmmirror.com/mirrors/sharp"
48
+ npm config set sharp_libvips_binary_host "https://npmmirror.com/mirrors/sharp-libvips"
49
+ npm install sharp
50
+ ```
51
+
52
+ ### Global install
53
+
54
+ ```bash
55
+ npm install piclist -g
56
+
57
+ # or
58
+
59
+ yarn global add piclist
60
+ ```
61
+
62
+ ### Local install
63
+
64
+ ```bash
65
+ npm install piclist -D
66
+
67
+ # or
68
+
69
+ yarn add piclist -D
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ ### Docker
75
+
76
+ You can use docker to run PicList-Core.
77
+
78
+ #### docker run
79
+
80
+ Change the `./piclist` to your own path, this path is where you put your `config.json` file, and change the `piclist123456` to your own secret key.
81
+
82
+ ```bash
83
+ docker run -d \
84
+ --name piclist \
85
+ --restart always \
86
+ -p 36677:36677 \
87
+ -v "./piclist:/root/.piclist" \
88
+ kuingsmile/piclist:latest \
89
+ node /usr/local/bin/picgo-server -k piclist123456
90
+ ```
91
+
92
+ #### docker-compose
93
+
94
+ download `docker-compose.yml` from this repo, or copy the following content to `docker-compose.yml`:
95
+
96
+ ```yaml
97
+ version: '3.3'
98
+
99
+ services:
100
+ node:
101
+ image: 'kuingsmile/piclist:latest'
102
+ container_name: piclist
103
+ restart: always
104
+ ports:
105
+ - 36677:36677
106
+ volumes:
107
+ - './piclist:/root/.piclist'
108
+ command: node /usr/local/bin/picgo-server -k piclist123456
109
+ ```
110
+
111
+ You can change the `./piclist` to your own path, this path is where you put your `config.json` file, and change the `command` to your own secret key.
112
+
113
+ Then run:
114
+
115
+ ```bash
116
+ docker-compose up -d
117
+ ```
118
+
119
+ #### Install plugins in docker
120
+
121
+ You can use `docker exec` to install plugins in docker.
122
+
123
+ ```bash
124
+ docker exec -it piclist sh
125
+ picgo install picgo-plugin-xxx
126
+ ```
127
+
128
+ #### Change config in docker
129
+
130
+ You can use `docker exec` to change config in docker.
131
+
132
+ ```bash
133
+ docker exec -it piclist sh
134
+ picgo set xxx
135
+ ```
136
+
137
+ ### Server
138
+
139
+ You can use `picgo-server` to start a server, default port is `36677`.
140
+
141
+ Start server:
142
+
143
+ ```bash
144
+ picgo-server
145
+ node ./bin/picgo-server
146
+ ```
147
+
148
+ > It's highly recommended to add `--key` to avoid unauthorized access. Example: `picgo-server --key 123456`,
149
+
150
+ Show help:
151
+
152
+ ```bash
153
+ $ picgo-server -h
154
+
155
+ Usage: picgo-server [options]
156
+
157
+ Options:
158
+
159
+ -h, --help Print this help message
160
+ -c, --config Set config path
161
+ -p, --port Set port, default port is 36677
162
+ --host Set host, default host is 0.0.0.0
163
+ -k, --key Set secret key to avoid unauthorized access
164
+ -v, --version Print version number
165
+
166
+ Examples:
167
+ picgo-server -c /path/to/config.json
168
+ picgo-server -k 123456
169
+ picgo-server -c /path/to/config.json -k 123456
170
+ ```
171
+
172
+ #### endpoints
173
+
174
+ - `/upload?picbed=xxx&key=xxx` upload picture, `picbed` to set pic-bed, `key` to set secret key
175
+ - `/heartbeat` heartbeat
176
+
177
+ ### Use in CLI
178
+
179
+ > PicList-Core uses `SM.MS` as the default upload pic-bed.
180
+
181
+ Show help:
182
+
183
+ ```bash
184
+ $ picgo -h
185
+
186
+ Usage: picgo [options] [command]
187
+
188
+ Options:
189
+
190
+ -v, --version output the version number
191
+ -d, --debug debug mode
192
+ -s, --silent silent mode
193
+ -c, --config <path> set config path
194
+ -h, --help output usage information
195
+
196
+ Commands:
197
+
198
+ install|add <plugins...> install picgo plugin
199
+ uninstall|rm <plugins...> uninstall picgo plugin
200
+ update <plugins...> update picgo plugin
201
+ set|config <module> [name] configure config of picgo modules
202
+ upload|u [input...] upload, go go go
203
+ use [module] use modules of picgo
204
+ init [options] <template> [project] create picgo plugin\'s development templates
205
+ ```
206
+
207
+ #### Upload a picture from path
208
+
209
+ ```bash
210
+ picgo upload /xxx/xx/xx.jpg
211
+ ```
212
+
213
+ #### Upload a picture from clipboard
214
+
215
+ > picture from clipboard will be converted to `png`
216
+
217
+ ```bash
218
+ picgo upload
219
+ ```
220
+
221
+ ### Use in node project
222
+
223
+ #### Common JS
224
+
225
+ ```js
226
+ const { PicGo } = require('piclist')
227
+ ```
228
+
229
+ #### ES Module
230
+
231
+ ```js
232
+ import { PicGo } from 'piclist'
233
+ ```
234
+
235
+ #### API usage example
236
+
237
+ ```js
238
+ const picgo = new PicGo()
239
+
240
+ // upload a picture from path
241
+ picgo.upload(['/xxx/xxx.jpg'])
242
+
243
+ // upload a picture from clipboard
244
+ picgo.upload()
245
+ ```
246
+
247
+ ## Documentation
248
+
249
+ For more details, you can checkout [documentation of PicGo-Core](https://picgo.github.io/PicGo-Core-Doc/).