piclist 1.9.10 → 1.9.11

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,22 @@
1
+ ## :tada: 1.9.11 (2025-02-27)
2
+
3
+
4
+ ### :sparkles: Features
5
+
6
+ * **custom:** optimize getconfig to hot-reload ([da65a05](https://github.com/Kuingsmile/PicList-Core/commit/da65a05))
7
+
8
+
9
+ ### :bug: Bug Fixes
10
+
11
+ * **custom:** fix alist output url bug ([3270f67](https://github.com/Kuingsmile/PicList-Core/commit/3270f67))
12
+
13
+
14
+ ### :pencil: Documentation
15
+
16
+ * **custom:** add chinease readme.md ([08386c3](https://github.com/Kuingsmile/PicList-Core/commit/08386c3))
17
+
18
+
19
+
1
20
  ## :tada: 1.9.10 (2024-12-27)
2
21
 
3
22
 
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # PicList-Core
2
2
 
3
+ English | [简体中文](./README_cn.md)
4
+
3
5
  ![standard](https://img.shields.io/badge/code%20style-standard-green.svg?style=flat-square)
4
6
  ![GitHub](https://img.shields.io/github/license/mashape/apistatus.svg?style=flat-square)
5
7
  ![node](https://img.shields.io/badge/node-%3E%3D16.0.0-blue?style=flat-square)
@@ -8,7 +10,7 @@
8
10
 
9
11
  A tool for picture uploading. Both CLI & api supports. It also supports plugin system, please check [Awesome-PicGo](https://github.com/PicGo/Awesome-PicGo) to find powerful plugins.
10
12
 
11
- Based on Picgo-Core and add more features.
13
+ Based on PicGo-Core with additional features.
12
14
 
13
15
  **Typora support natively**.
14
16
 
@@ -18,7 +20,7 @@ Based on Picgo-Core and add more features.
18
20
  - Set watermark and compress parameters through `picgo set buildin watermark` and `picgo set buildin compress` under CLI command
19
21
  - Image processing is beforeTransform, which does not conflict with any plugin
20
22
  - Add support for advanced rename, you can set the rename rule through `picgo set buildin rename` under the CLI command
21
- - Add new built-in picbed: WebDAV, SFTP, Local path
23
+ - Add new built-in picbed: WebDAV, SFTP, Local path, AWS S3
22
24
  - Adds support for imgur account uploads
23
25
  - Built-in server just like PicList-Desktop server, you can use `picgo-server` to start the server
24
26
  - Fix several bugs of PicGo-Core
@@ -113,6 +115,15 @@ docker exec -it piclist sh
113
115
  picgo install picgo-plugin-xxx
114
116
  ```
115
117
 
118
+ #### Change config in docker
119
+
120
+ You can use `docker exec` to change config in docker.
121
+
122
+ ```bash
123
+ docker exec -it piclist sh
124
+ picgo set xxx
125
+ ```
126
+
116
127
  ### Server
117
128
 
118
129
  You can use `picgo-server` to start a server, default port is `36677`.
package/README_cn.md ADDED
@@ -0,0 +1,239 @@
1
+ # PicList-Core
2
+
3
+ [English](./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
+ 一个用于图片上传的工具。同时支持CLI和API调用。它还支持插件系统,请查看[Awesome-PicGo](https://github.com/PicGo/Awesome-PicGo)获取强大的插件。
12
+
13
+ 基于PicGo-Core并添加了更多功能。
14
+
15
+ **原生支持Typora**。
16
+
17
+ ## 新增功能
18
+
19
+ - 增加水印、压缩和转换图片格式功能
20
+ - 通过CLI命令`picgo set buildin watermark`和`picgo set buildin compress`设置水印和压缩参数
21
+ - 图像处理在beforeTransform阶段进行,不会与任何插件冲突
22
+ - 增加高级重命名支持,你可以通过CLI命令`picgo set buildin rename`设置重命名规则
23
+ - 新增内置图床:WebDAV、SFTP、本地路径、AWS S3
24
+ - 增加对imgur账户上传的支持
25
+ - 内置服务器功能,与PicList-Desktop服务器相似,你可以使用`picgo-server`启动服务器
26
+ - 修复了PicGo-Core的多个错误
27
+
28
+ ## 安装
29
+
30
+ PicList需要node.js >= 16版本
31
+
32
+ ### 安装前准备
33
+
34
+ 由于PicList依赖[sharp](https://sharp.pixelplumbing.com/),你需要在安装PicList前先安装sharp。
35
+
36
+ ```bash
37
+ npm config set sharp_binary_host "https://npmmirror.com/mirrors/sharp"
38
+ npm config set sharp_libvips_binary_host "https://npmmirror.com/mirrors/sharp-libvips"
39
+ npm install sharp
40
+ ```
41
+
42
+ ### 全局安装
43
+
44
+ ```bash
45
+ npm install piclist -g
46
+
47
+ # 或者
48
+
49
+ yarn global add piclist
50
+ ```
51
+
52
+ ### 本地安装
53
+
54
+ ```bash
55
+ npm install piclist -D
56
+
57
+ # 或者
58
+
59
+ yarn add piclist -D
60
+ ```
61
+
62
+ ## 使用方法
63
+
64
+ ### Docker
65
+
66
+ 你可以使用Docker运行PicList-Core。
67
+
68
+ #### docker run
69
+
70
+ 将`./piclist`更改为你自己的路径,该路径是放置`config.json`文件的位置,并将`piclist123456`更改为你自己的密钥。
71
+
72
+ ```bash
73
+ docker run -d \
74
+ --name piclist \
75
+ --restart always \
76
+ -p 36677:36677 \
77
+ -v "./piclist:/root/.piclist" \
78
+ kuingsmile/piclist:latest \
79
+ node /usr/local/bin/picgo-server -k piclist123456
80
+ ```
81
+
82
+ #### docker-compose
83
+
84
+ 从本仓库下载`docker-compose.yml`,或将以下内容复制到`docker-compose.yml`:
85
+
86
+ ```yaml
87
+ version: '3.3'
88
+
89
+ services:
90
+ node:
91
+ image: 'kuingsmile/piclist:latest'
92
+ container_name: piclist
93
+ restart: always
94
+ ports:
95
+ - 36677:36677
96
+ volumes:
97
+ - './piclist:/root/.piclist'
98
+ command: node /usr/local/bin/picgo-server -k piclist123456
99
+ ```
100
+
101
+ 你可以将`./piclist`更改为你自己的路径,该路径是放置`config.json`文件的位置,并在`command`中更改密钥。
102
+
103
+ 然后运行:
104
+
105
+ ```bash
106
+ docker-compose up -d
107
+ ```
108
+
109
+ #### 在Docker中安装插件
110
+
111
+ 你可以使用`docker exec`在Docker中安装插件。
112
+
113
+ ```bash
114
+ docker exec -it piclist sh
115
+ picgo install picgo-plugin-xxx
116
+ ```
117
+
118
+ #### 在Docker中更新配置
119
+
120
+ 你可以使用`docker exec`在Docker中更新配置。
121
+
122
+ ```bash
123
+ docker exec -it piclist sh
124
+ picgo set xxx
125
+ ```
126
+
127
+ ### 服务器
128
+
129
+ 你可以使用`picgo-server`启动服务器,默认端口为`36677`。
130
+
131
+ 启动服务器:
132
+
133
+ ```bash
134
+ picgo-server
135
+ node ./bin/picgo-server
136
+ ```
137
+
138
+ > 强烈建议添加`--key`参数以避免未经授权的访问。例如:`picgo-server --key 123456`
139
+
140
+ 显示帮助:
141
+
142
+ ```bash
143
+ $ picgo-server -h
144
+
145
+ Usage: picgo-server [options]
146
+
147
+ Options:
148
+
149
+ -h, --help 显示帮助信息
150
+ -c, --config 设置配置路径
151
+ -p, --port 设置端口,默认端口为36677
152
+ --host 设置主机,默认主机为0.0.0.0
153
+ -k, --key 设置密钥以避免未经授权的访问
154
+ -v, --version 显示版本号
155
+
156
+ Examples:
157
+ picgo-server -c /path/to/config.json
158
+ picgo-server -k 123456
159
+ picgo-server -c /path/to/config.json -k 123456
160
+ ```
161
+
162
+ #### 接口
163
+
164
+ - `/upload?picbed=xxx&key=xxx` 上传图片,`picbed`用于设置图床,`key`用于设置密钥
165
+ - `/heartbeat` 心跳检测
166
+
167
+ ### CLI使用
168
+
169
+ > PicList-Core使用`SM.MS`作为默认上传图床。
170
+
171
+ 显示帮助:
172
+
173
+ ```bash
174
+ $ picgo -h
175
+
176
+ Usage: picgo [options] [command]
177
+
178
+ Options:
179
+
180
+ -v, --version 输出版本号
181
+ -d, --debug 调试模式
182
+ -s, --silent 静默模式
183
+ -c, --config <path> 设置配置路径
184
+ -h, --help 输出使用信息
185
+
186
+ Commands:
187
+
188
+ install|add <plugins...> 安装picgo插件
189
+ uninstall|rm <plugins...> 卸载picgo插件
190
+ update <plugins...> 更新picgo插件
191
+ set|config <module> [name] 配置picgo模块
192
+ upload|u [input...] 上传,开始上传
193
+ use [module] 使用picgo模块
194
+ init [options] <template> [project] 创建picgo插件的开发模板
195
+ ```
196
+
197
+ #### 从路径上传图片
198
+
199
+ ```bash
200
+ picgo upload /xxx/xx/xx.jpg
201
+ ```
202
+
203
+ #### 从剪贴板上传图片
204
+
205
+ > 从剪贴板获取的图片将被转换为`png`格式
206
+
207
+ ```bash
208
+ picgo upload
209
+ ```
210
+
211
+ ### 在Node项目中使用
212
+
213
+ #### CommonJS
214
+
215
+ ```js
216
+ const { PicGo } = require('piclist')
217
+ ```
218
+
219
+ #### ES模块
220
+
221
+ ```js
222
+ import { PicGo } from 'piclist'
223
+ ```
224
+
225
+ #### API使用示例
226
+
227
+ ```js
228
+ const picgo = new PicGo()
229
+
230
+ // 从路径上传图片
231
+ picgo.upload(['/xxx/xxx.jpg'])
232
+
233
+ // 从剪贴板上传图片
234
+ picgo.upload()
235
+ ```
236
+
237
+ ## 文档
238
+
239
+ 获取更多详细信息,请查看[PicGo-Core文档](https://picgo.github.io/PicGo-Core-Doc/)。
package/bin/picgo CHANGED
@@ -1,25 +1,25 @@
1
- #!/usr/bin/env node
2
- const path = require('path')
3
- const minimist = require('minimist')
4
- const os = require('os')
5
-
6
- const argv = minimist(process.argv.slice(2))
7
- let configPath = argv.c || argv.config || ''
8
- if (configPath !== true && configPath !== '') {
9
- configPath = configPath.replace(/^~/, os.homedir())
10
- configPath = path.resolve(configPath)
11
- } else {
12
- configPath = ''
13
- }
14
- const { PicGo } = require('..')
15
- const picgo = new PicGo(configPath)
16
- picgo.registerCommands()
17
-
18
- try {
19
- picgo.cmd.program.parse(process.argv)
20
- } catch (e) {
21
- picgo.log.error(e)
22
- if (process.argv.includes('--debug')) {
23
- Promise.reject(e)
24
- }
25
- }
1
+ #!/usr/bin/env node
2
+ const path = require('path')
3
+ const minimist = require('minimist')
4
+ const os = require('os')
5
+
6
+ const argv = minimist(process.argv.slice(2))
7
+ let configPath = argv.c || argv.config || ''
8
+ if (configPath !== true && configPath !== '') {
9
+ configPath = configPath.replace(/^~/, os.homedir())
10
+ configPath = path.resolve(configPath)
11
+ } else {
12
+ configPath = ''
13
+ }
14
+ const { PicGo } = require('..')
15
+ const picgo = new PicGo(configPath)
16
+ picgo.registerCommands()
17
+
18
+ try {
19
+ picgo.cmd.program.parse(process.argv)
20
+ } catch (e) {
21
+ picgo.log.error(e)
22
+ if (process.argv.includes('--debug')) {
23
+ Promise.reject(e)
24
+ }
25
+ }