1.0.1 • Published 1 year ago

@xbl/notes-helper v1.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

notes-helper

是使用 Nodejs 写的笔记小助手,在 Git 目录中自动同步到远端仓库的脚本工具

创建配置文件

在对应的 Git 目录中创建 .notes-helper.json

{
    "events": {
        "addDir": "touch .gitkeep && git add . && git commit -m 'notes add folder' && git push",
        "add": "git add . && git commit -m 'notes add file' && git push",
        "change": "git add . && git commit -m 'notes change file' && git push",
        "unlink": "git add . && git commit -m 'notes unlink' && git push"
    }
}

使用 chokidar 监听目录变化,监听变化事件产生执行对应的 shell 命令。

此处忽略了 git 初始化等操作。

执行 notes-helper 命令

方法一:使用 npx,在对应的目录执行如下命令

npx @xbl/notes-helper

方法二:全局安装

npm install -g @xbl/notes-helper

# 在对应目录执行
@xbl/notes-helper