Skip to content

Commit

Permalink
Remove unnecessary dependencies (#171)
Browse files Browse the repository at this point in the history
虽然 package.json 中仅定义了两个依赖,但最终会安装 290 个包。而实际上一个依赖
都不需要添加。

对于 hexo-fs,此项目使用到的几个 API,直接使用 Node.js 的 fs 模块就足够了。
hexo-fs 是添加了更多的文件 watch 等功能,此项目并没有用到。

对于 hexo-log,在 `hexo` 变量上,已经有初始化过的 `log` 可以直接用,没必自
己引入 hexo-log 再创建个实例。而且使用 `hexo.log` 还有个好处是 debug 和
slient 等配置,还会继承用户执行 `hexo` 命令时使用的 `--debug` 和 `--slient`
等参数配置。

Signed-off-by: val <gwval3344@foxmail.com>

Co-authored-by: val <gwval3344@foxmail.com>
  • Loading branch information
val3344 and val3344 authored Mar 9, 2021
1 parent 44d6a50 commit 935fe8f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
'use strict';

const crypto = require('crypto');
const fs = require('hexo-fs');
const fs = require('fs');
const path = require('path');
const log = require('hexo-log')({ 'debug': false, 'slient': false });
const log = hexo.log;

const defaultConfig = {
'abstract': 'Here\'s something encrypted, password is required to continue reading.',
Expand Down
5 changes: 0 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
"bugs": {
"url": "https://github.com/D0n9X1n/hexo-blog-encrypt/issues"
},
"dependencies": {
"hexo-fs": "^1.0.2",
"hexo-log": "^0.2.0"
},
"description": "Yet, just another blog encrypt plugin for hexo.",
"homepage": "https://github.com/D0n9X1n/hexo-blog-encrypt#readme",
"keywords": [
Expand All @@ -25,7 +21,6 @@
}
],
"name": "hexo-blog-encrypt",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/D0n9X1n/hexo-blog-encrypt.git"
Expand Down

0 comments on commit 935fe8f

Please sign in to comment.