Skip to content

Commit 3c2800e

Browse files
committed
chore: 初始化项目结构
0 parents  commit 3c2800e

File tree

7 files changed

+4167
-0
lines changed

7 files changed

+4167
-0
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# 忽略node_modules
2+
node_modules/
3+
# 忽略TypeScript编译输出
4+
dist/
5+
*.html

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 ReRokutosei
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# PicGo Local Backup Plugin
2+
3+
本地备份插件 for [PicGo-Core](https://github.com/PicGo/PicGo-Core)
4+
5+
## 功能特点
6+
7+
- 上传图片时自动备份到本地目录
8+
- 支持复制或剪切操作
9+
- 支持自定义文件名模板,包含多种占位符
10+
- 详细的日志记录系统
11+
12+
## 安装
13+
14+
### 方式1:通过 npm 安装(推荐)
15+
16+
```bash
17+
# 全局安装 picgo
18+
npm install picgo -g
19+
20+
# 安装本插件
21+
picgo install @rerokutosei/picgo-plugin-localbackup
22+
```
23+
24+
### 方式2:手动安装
25+
26+
1. 克隆本仓库
27+
2. 在仓库目录下执行:
28+
```bash
29+
npm install
30+
npm run build
31+
```
32+
3. 将生成的 `dist` 目录复制到 PicGo 的插件目录中
33+
34+
## 配置
35+
36+
插件提供以下配置项:
37+
38+
1. `backupDir`: 备份目录路径(默认: './backup')
39+
2. `operationType`: 操作类型('copy' 或 'cut')
40+
3. `renameTemplate`: 文件重命名模板
41+
42+
### 重命名模板支持的占位符:
43+
44+
- `{filename}`: 原始文件名(不含扩展名)
45+
- `{extname}`: 文件扩展名(包含点号)
46+
- `{timestamp}`: 时间戳
47+
- `{uuid}`: 唯一标识符
48+
- `{date:format}`: 日期格式化,例如 `{date:yyyy-MM-dd}`
49+
50+
### 示例配置:
51+
52+
```bash
53+
picgo set plugin @rerokutosei/picgo-plugin-localbackup
54+
```
55+
56+
## 日志
57+
58+
插件会在备份目录的 `logs` 子目录下生成日期格式的日志文件,记录所有备份操作。
59+
60+
## 开发
61+
62+
```bash
63+
# 安装依赖
64+
npm install
65+
66+
# 编译
67+
npm run build
68+
```
69+
70+
## License
71+
72+
MIT © ReRokutosei

0 commit comments

Comments
 (0)